Car Crash Damage/Detecting Force of Two Objects Hitting One Another

Godot Version

4.2.2

Question

I am making a racing game. In this game, when a car hits an obstacle, such as a wall or barrel, I want to get the force of the collision and use it to apply damage based on it.

I previously did this by getting the linear velocity of the previous frame and using that to track force on the frame of collision. However, this no longer works. I think this is because I switched physics_process with integrate_forces (since the car nodes are rigid bodies). Now the linear velocity and previous linear velocity are the same.

Does anyone know another way to track the force of a collision?

The reason it was not working is because the previous linear velocity variable was updating every frame (too fast), so instead I updated it every second using a timer.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.