best way to determine approach/recede

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
If AskingActor's movement is irrelevant (ProbedActor is trying to get away) you could use
Code:
f = Normal(ProbedActor.Location - AskingActor.Location) dot Normal(ProbedActor.Velocity);
Positive values for f -> ProbedActor tries to get closer to AskingActor
Negative values for f -> ProbedActor tries to get away from AskingActor

But if you want to check whether ProbedActor really gets closer to /away from AskingActor use
Code:
f = Normal(ProbedActor.Location - AskingActor.Location) dot Normal(ProbedActor.Velocity - AskingActor.Velocity);
Positive values for f -> ProbedActor gets away from AskingActor
Negative values for f -> ProbedActor gets closer to AskingActor