GetDistanceTo not updating in 4.9.2 blueprint

In my project, I have my player which is of type Pawn, and an enemy, also of type Pawn. Both actors have a visible static mesh and are constantly moving, and I am trying to use the GetDistanceTo function so I can gauge if the player is close enough to the enemy for the enemy to take an action. However, after the initial call, GetDistanceTo never changes. The value is ALWAYS the same.

Just as a test, I placed a short call to it in the tick event of my enemy, with a PrintString call. I couldn’t think of anything more basic to try, but it never updates there either. :confused:

Help!?!

Another way you can do it is find the world location of both actors, subtract the two vectors, and then get vector length.

That worked! I should have thought of that - facepalm

Thanks! I still rather hope EPic looks and can chime in to why the GetDistanceTo function isn’t updating, in case it’s more widespread…

I just tested it in a blank project and it worked for me.

I had the same problem. The problem was that I was calculating the difference between the controller (because GetDistanceTo defaulted to self) and the OtherActor. But I should use the ControlledPawn instead of the controller obviously to measure the distance.