How do you measure distance between two actors inside the animation blueprint?

Hi, I’m fairly new to Unreal Engine. I wanted to ask if there’s a way to measure the distance between two actors in this case the player pawn and the enemy pawn.

I’m trying to get the enemy pawn to play an animation (attack) when the player gets a certain distance from it.

Use the “DistanceFromChar” value that you set in the blueprint and feed it into a “>” or <" node and then use the result in a “Branch” node in your white execution flow to either go to the part where the animation is triggered or bypass that

Am I doing something wrong I forgot to say I tried that, it seems to work and all but when in-game in can’t call the function “GetPlayerPawn”.

thanks for taking the time to answer my question.

I’m not an expert myself, not using much of the predefined player system, but try GetPlayerController and from that then GetActorLocation or GetActorTransform

Otherwise it sounds like you don’t have a player character in game, that would be something there with your whole setup, if you spawn a character and you can run around though, then you should have one, so can’t help with those problems, but try the other nodes I gave you, maybe they help