How to find if an actor is in front or behind another actor?

Hi, the following may work for you:

  1. Use Get Actor Forward Vector node
  2. Compute Vector To Target by subtracting your location from target location and normalize that vector
  3. Perform a vector dot operation between those two vectors and get the arccos (maybe there is a builtin vector angle function, idk), then you have the angle between those vectors. You then can specify a tolerance and compare.

Maybe you want to change a few things according to your needs, e.g. don’t take pitch rotation of your character into account.

2 Likes