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.
answered Apr 01 '19 at 04:38 AM
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.
answered Apr 01 '19 at 01:40 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here