I’m currently working in a 2d ball game and I need to show the trajectory of the ball before being thrown. To achieve that, I clone my scene and run a simulation using PhysicsScene2D.Simulate(Time.fixedDeltaTime)
The problem is that the simulation is not taking into consideration the lost of momentum due to the friction during the collisions and it’s not accurate. I realized that if I set the friction of the ball to 0, or if I disable the rotation in the Z axis from the rigidbody2D, the simulation is completely accurate. Unfortunately, I need to have friction and I need the simulation to work with it, is it possible?
I’m using Unity 2020.3.29f1
The dotted line is the calculated trajectory, the solid line is the actual movement of the ball.