Download

GetActorLocation returning incorrect values?!

I’m trying to create basic pathfinding AI and I’m pretty much done, the problem is that the GetActorLocation node isn’t returning the location of my player character which results in the AI just moving to the center of the scene. Thanks for reading! ^^

Edit: Okay, turns out my TargetPlayer is not valid. I hooked up my custom event and TargetPlayer actor to an “isvalid” macro and then connected the “Is Not Valid” exe pin to the Simple Move to Location node, the AI moves to the center of my scene and I get an error when I exit the game whereas if I connect the “Is Valid” exe pin to it instead, the AI doesn’t move at all and when I exit the game, I don’t get any errors

You need to set “Target Player” to something before you can use it. So how do you set it?

I’m such a doofus XD How did I not remember that?! Thank you. All I did was Event Begin Play Cast to Character Blueprint, right click on “As Character Blueprint”, promote to variable and named it TargetPlayer