[Solved] How to know if the object is moving upward or downward?
[ad_1] Assuming that the object has a rigidbody, you can use this in the update method (or anywhere for that matter) of a MonoBehavior attached to your GameObject. Rigidbody rb = GetComponent<Rigidbody>(); float verticalVelocity = rb.velocity.y; If you want the velocity along any axis, you can use the dot product: Rigidbody rb = GetComponent<Rigidbody>(); Vector3 … Read more