I’m using a combination of a VectorForce and a Torque to move and turn my boat. I’m also using an AngularVelocity and AlignPosition to keep the boat at sea level and make sure it does not tip over but I do not think it is related to this issue.
My Issue is that when the boat is going forward and turns, instead of the vectorforce being applied in the direction the boat is facing, it’s like the force is being applied in a different direction and it makes the movement look really bad.
Here is the code I’m using to calculate the force for the vectorforce:
General Direction? I tried the above calculation except this time I also multiplied the LookVector of the vehicleSeat but it resulted in it not even moving
Which direction is it going? If it’s being relative to the world (e.g. going the same direction no matter were the boat is turned), you should change vehicleSeat.F.RelativeTo = Enum.ActuatorRelativeTo.Attachment0 (either in studio or with code).
If it’s going in the wrong direction as in going sideways or something, try doing
Relative to attachment means it moves relative to the direction the seat is facing (e.g. right relative to seat is in the direction of the player’s right arm).
Relative to world means it moves relative to the world’s axis (so even if the boat turns, it will still go in the same direction).
You can think of the world’s axis like going North (always the same direction) instead of going forwards (which is relative to where you’re facing).
Ohhhh. It’s because it’s using a Force instead of a Velocity. A force accelerates it in a direction, so it keeps going in that direction even after you turn (in real life, drag slows it down (especially on turns) but water physics aren’t really coded on Roblox, so its momentum keeps it going in the same direction).
The linear velocity causes a speed in a certain direction, so the units are speed. What’s nice about that is you don’t need to do any math with the mass.
So if you want it to go 15 studs/second forward, just set it to be Vector(15,0,0).
The other way you could do this is use an angular velocity with its speed set to 0,0,0 and linear velocity with its speed also set to 0,0,0. This would act like a drag force: it would always try to slow down the boat and stop it from turning. Then use the force and torque you’re currently using.
That might be more realistic, since it would have the boat speed up and slow down.
It worked somewhat nicely but the issue is still there, it is set relative to Attachment0 and the Torque is relative to Attachment0 aswell.
I also should mention I have an AlignOrientation and an AlignPosition which keeps the boat upright however I dont think those are related to this issue.