Topic was automatically imported from the old Question2Answer platform.
Asked By
rayosdev
Old Version
Published before Godot 3 was released.
I’m trying to measure the force applied to one RigiedBody2D to another. Is there a function for this or is it just a question of vector math? in witch case a hint about what that type of math is called would be apreaciate
A possible solution to your problem that may be worth testing is just monitoring the length (magnitude) of the velocity vector of your chosen object. After a collision compare the difference in length. If it loses force it’s velocity magnitude should shrink, if it gains force, then the magnitude will grow.
Depending on the frame timing, the difference between the current and previous velocity magnitude might answer that question.
There is the Physics2DTestMotionResult too but I don’t know how it is used.
eons | 2017-01-23 10:33
Just one correction: that’s called an elastic collision. You get an inelastic collision when the colliding objects deform and stay deformed like bags of sand.