Hello there. I am currently designing a physics based controller for ships in a sea game. I understand mostly everything but I have some issues with tweaking.
My first question is: How is force measured in ROBLOX?
I am asking that question because when I put a vector force on a 1x1x1 Part it takes around 100 to actually lift it up. In my mind that makes no sense as gravity in roblox is 196.2 .
The reason why I need to know this is because I would like to be able to calculate the acceleration and the speed of the ship.
My second question is: How is density measured in ROBLOX?
I understand that 1 density is equivalent to 1 cm^3 of water.
My third question is: How do I calculate drag through water?
I do not understand if there are any ways to do this. I have looked around and found none.
I also need a little help understanding how much torque is required to rotate an object through water. I need this type of information since I do not know how to calculate this and I would like for the boats to all simulate how they would actually feel in water.
When in doubt, steal code from other game engines, I have done this to implement my CCD inverse kinematics:
I found a cool looking one for unity and it has the drag formula you are looking for at this time section. Plus I trust it because the end result looks really cool and as you expect it to be.
Drag force = -ships current velocity * waterDragCoefficient * fixedDeltaTime * displacementMultiplier
Explanation:
ships current velocity = part.Velocity explanatory, negative means in the opposite direction so it makes it slow down, explanatory as well.
drag coefficient = Just some random number value unless you want to get real realistic.
deltaTime = deltaTime, maybe you won’t need it because BodyForce does this for you with the engines timestep I believe.
displacementMultiplier = How much the ship is submerged in the water. More water mo friction mo realistic.
Yeah as you said the force units in Roblox don’t really make sense and usually we want direct control over the acceleration and the speed of the ship usually in studs per second squared and seconds respectively no matter the mass of the ship and all those complicated additional variables.
To find a force equivalent in Roblox to reach those units I recommend using a PID Controller because tbh it’s all guess work.