Hello,
In my game, a car is moved around be force. I calculate its speed using
transform.rigidbody.velocity.magnitude;
and show it to the user. When the object goes backwards, the velocity still stays in the positive values. That’s fine as long as I can tell that the object is moving backwards. But how can I do that? My only idea is using velocity.magnitude, but it returns a positive value anyway. Is there no way for my script to know if the object is moving backwards?
I’m not good with angles so I can’t do that. My idea would be to get the object’s facing direction and somehow calculate if the global x and z change and by what values. This looks like a very inefficient way to do things though.