I want to know if the rb2D is moving away or towards the other position. The rb2D could be traveling anywhere along the x and y axis. So assume the other position is a vertical line running down the center of the screen. Unless the rb2D is just bouncing up and down (which it isn't), it's either going to be moving towards or away from the other position. Is there a formula to determine this?
How to know if a rigidbody2D is moving away or towards another position?
Sean Carey
- 694
- 6
- 14