Hi, My game needs a boat for the player to buy and then drive, I finished going forward and stopping but I'm using BodyAngularVelocity for the steering and the code is as following (using VehicleSeats):
local seat = script.Parent.VehicleSeat seat.Changed:Connect(function(p) -- forward/backward code goes here --steering if p == "Steer" then if seat.Steer == 1 then -- go right script.Parent.PrimaryPart.BodyAngularVelocity.AngularVelocity = script.Parent.PrimaryPart.CFrame.RightVector elseif seat.Steer == -1 then --go left script.Parent.PrimaryPart.BodyAngularVelocity.AngularVelocity = -script.Parent.PrimaryPart.CFrame.RightVector else -- no steer script.Parent.PrimaryPart.BodyAngularVelocity.AngularVelocity = Vector3.new(0,0,0) end end end)
Are there any other ways that I could just rotate the boat to face it's RightVector and LeftVector (-RightVector)?
Lol, I'm working on the same exact thing you are at the moment. Here's what I came up with.
local Control = script.Parent.Parent.Parent.Hull.Control script.Parent:GetPropertyChangedSignal("Steer"):Connect(function() if script.Parent.Steer == 1 then while script.Parent.Steer == 1 do Control.BodyGyro.cframe = Control.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,-0.5,0) wait(1) end elseif script.Parent.Steer == -1 then while script.Parent.Steer == -1 do Control.BodyGyro.cframe = Control.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,0.5,0) wait(1) end end end)