I am practicing making boat driving but I am stuck on how to get my boat to tilt properly.
I am currently using a LinearVelocity and an AngularVelocity to control the boat and currently I have gotten this far:
I have looked all around the devforum for ways to make a tilting mechanic but most of them are using
old bodymovers like BodyGyros which are deprecated and I’m not sure how to apply it to an AngularVelocity or they use C0 welds and motor6ds which I am also not sure how to add (I am not very good at CFrame / vector maths).
I have tried different properties to see if it would help but it didn’t.
I have tried to use a separate AlignOrientation for tilting but it won’t work as it and the AngularVelocity cancel each other out.
My AngularVelocity Properties:
My current code:
seatPart.Changed:connect(function(property)
if property == "SteerFloat" then
VehicleAngularVelocity.AngularVelocity = (CFrame.new(0, math.rad((-seatPart.SteerFloat * seatPart.TurnSpeed) * 90), seat.SteerFloat * 1.5)).Position
elseif property == "ThrottleFloat" then
local torque = math.abs(seatPart.ThrottleFloat) * seatPart.Torque
if torque == 0 then torque = 2000 end
if seatPart.ThrottleFloat < 0 then torque /= 2 end
VehicleLinearVelocity.VectorVelocity = Vector3.new(0, 0, math.sign(seatPart.ThrottleFloat) * maxSpeed)
end
end)
boats on roblox (especially with high mass and roblox’s glitchy physics) can be hard to tune and even i haven’t refined it all the way.
if this doesn’t work for you that’s fine maybe someone else can help you better.
you can always keep trying to tune which axis your boat rotates on and which constraints you use, whatever works best.
sorry i misread: for tilting i’d just set the cframe manually unless you want to use roblox physics in that case maybe you can use torque objects? i don’t know. you can take the local z axis of the rotation and just add an angle based on the tilt you want.
Thank you. I have worked out how to make it move forward and turn I’m just current trying to figure out how to make it tilt when turning and stuff but thanks for your help.
If you balance the mass and density of the boat parts and have a keel weight below the boat it should tilt properly.
The VectorForce and Torque in my example boat will allow the boat to tilt on the water’s surface. You only need those 2 forces and proper bouyancy/balance for it to work.
Use the 2 boats in the model I put in the post I linked and see what I mean.
Trust me about this. I have a whole game that works on these principles.
another good idea! try shifting the center of mass instead of using align orientation, just put two parts on each side and tune their weights, and when you want to tilt to that side just set them to not massless, same with the other.
Thank you that sounds like a really good solution but, I actually figured out how to turn boat using an align orientation, (I realized that BodyGyro and AlignOrientation are very similar so I followed an old tutorial for a helicopter turning system from HowToRoblox youtube but replaced the BodyGyro with an AlignOrientation), then you just apply the tilt you want on the z axis based on the way you are going.