Hello,
What's the best way to detect if the distance between two objects is increasing or decreasing?
The idea I have is to take distance at time 1 distance at time 2, then subtract distance 1 from distance 2. If the result is positive, the target object is moving away from the player. If the result is negative, the target object is moving toward the player.
The result determines which event is sent next. I'm working on a script to do this, but I'm pretty new at C#, so I wanted to get your ideas first. Any advice is appreciated.
Edit: I'm messing around with Float Operator, Float Compare, and Float Sign Test, but I can't seem to get them to function with the two Get World Distance variables I've created.