Godot Version
4.5
Question
I’m curious as to whether or not the angular/linear dampening functions the same as real life air resistance.
The amount of force air resistance exerts scales with the square of the speed, for example, 20 mph winds exert 4x the force of 10 mph winds. This is because the air is moving twice as fast, and twice the air is hitting you.
I’m curious to know if linear dampening works the same way, if it slows a rigidbody2d down four times as much for going twice the speed, or if it only slows down twice as much.
If it only slows down twice as much, what are some ways to program objects to slow down realistically?
Afaik liner_damp is used to directly scale the velocity. Something like velocity = velocity * (1 - damp * delta). So it’s not treated like an actual force.
If you want a custom drag force you can calculate it every frame depending on the current velocity and just directly apply it to the body.
I’m a bit worried about directly editing an object’s velocity, so I might try changing the linear dampening for a given object every frame based on its speed. I’d still need to find the right equation for that, though.
If I end up adding wind, I’d have to rely on using constant linear force instead.
You’re not supposed to alter the velocity directly. Just use it to calculate drag force every frame as you stated that you want a velocity dependent damp that emulates air drag. Then just apply that force by calling apply_central_force()
Thank you! I’m still new to Godot and the physics engine.