How to get location of a spawned actor?

Hello,
I am very much a beginner to UE4, but i managed to get some simple things to work via the help of tutorials and all.
But now i am stuck at how to get a location of an object that is spawned in on click.

I basically want to spawn an object at the cursor location of the mouse and then teleport my character to that location. After which, once the character is at that location and overlapping the spawned object, that object will be destroyed.

I got the actors to spawn at mouse cursor location (more or less) and got it to be destroy on overlap with the character as well, now i am trying to figure out how to a transform location of the spawned actor to teleport my character to that location.

As I am writing this, I am also releasing that don’t really need the actor for teleport location, instead i could just teleport the character there with the help of mouse cursor location, but i would like to try my way once anyway as i am almost there.

You could store its Transform in a variable on its BeginPlay event (using Get Actor Transform) then have it Casted to your player Pawn to be used for teleportation.

There’s no reason to store anything actually, why not just Get Transform of the actor. Also, no need to cast anything - both inherit from Actor.

Welcome IRishOnline, to do this you will need to get a reference to your spawned in actor (assuming your player BP isn’t the one spawning the actor). So from within the player BP you will need to either use a node like “get all actors of class” (ok if you only spawn one actor in), or from the spawning blueprint get a reference to your player character by using the node “Get Player Character” and the cast the output to your player character. Once you have that you can set variables inside your player character one of which can be the location of this actor. Or you can directly teleport the player from the spawning blueprint using the transform of the spawned actor. Moving the character from within the spawning blueprint is probably the easiest method. If you need help understanding casting/references check out the tutorials below. It is a very beginner friendly series that goes over much of the basics of creating game play mechanics in blueprints.