Get actor location not working

How are you setting the variable that contains the reference to the player?

I need my pawn to move to the location of my actor. As you can see in the pictures below,I have set up the actor blueprint as a variable and retrieved his location. But the coordinates always remain 0 0 0,no matter which get xxxx location I use.

I created a new variable,and selected my actor blueprint as its type. I’ve tried casting it to the Actor blueprint,but ran into several errors that I couldn’t resolve(so I deleted the cast to).

can you show that part of the blueprint? cos thats likely where this will be starting to go wrong.

Try “Get Player Pawn”, drag off the result pin into “get actor location” that way you will definately be getting the players current location.

Sorry i must have misunderstood.

Then your player needs a way of detecting the item.
a sphere trace works well at a certain range, it will return the location of the actor, feed that result into the movement inpuit.

Well,the first method is visible from the first picture(HoopBP is the name of my actor blueprint I’m trying to get the location of).
The other method was shown to me by a streamer. I don’t even know what the object wildcard is.

But if you have another method of retrieving an actor’s location inside this BP I’d like to take a look at it.

No,the pawn needs to move to the Actor’s location,not to itself.

You can do one thing, create this variable in your GameMode or Player Blueprint. Then you can easily cast to your Game mode or Player Character BP to access this variable.

I’ve set up some kind of sphere trace,but I’m not sure what to put in the array.
I’m trying to detect an actor blueprint class.


I’m a bit lost there.

You are not setting value of the variable which is leading to errors. Have a look at the following article to make blueprints communication and let me know if it help in solving your problem. unrealenginetutorials.com

For me I had a similar issue where getting the Actor Location from Player Controller didn’t work but using Play Pawn did, thanks!