Save player location and teleport back to that location
I'm trying to figure out how to setup the following:
I'm on a ledge, I press E(double tap or single for now) now my character's position is saved after pressing E.
I fall off the ledge, or go somewhere in the map, press another input(double tap F or single for now) and then my character teleports back to where I saved with E.
Any pointers or directions would be lovely!
asked Jan 04 '16 at 05:44 AM in Blueprint Scripting
Hi man , You can store your location in a variable vector type. Add this vector call it "OLDlocation". When you pressed "E" set the OLDlocation with your location with the node "get actor location." When you press "F" set your actor world location to your OldLocation.
To use the key press you have to enable the input on that actor. If you are using a pawn you need to possess it.
answered Jan 04 '16 at 01:30 PM
First, if you have just one checkpoint. there is no purpose in using an array . You should just relocate your checkpoint. instead of spawning it
If you want more than one check point , and your question is how i keep the last i used. Since we dont know in wich way the get all actor of class order the checkpoint. You could just get their location first, check wich one is the nearest, and kill all but that.
However i suggest you to keep just 1 checkpoint spawned, or just use a variable in your char. to store the checkpoint location.
answered Jan 04 '16 at 03:11 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here