Teleportation troubles

I’m having a lot of trouble figuring out how to make a teleportation mechanism. The goal is to create a “mark” through Shift + 1 that can be attached to any character or actor. When marker is placed my character can teleport by pressing ‘F1’ to the mark at almost any given time (was thinking of giving it a 5 second delay for balancing reasons).
Then to destroy it CTRL + 1. I want to make it so that i can make up to 6 of these markers at all times (with same inputs just changing F keys). Thanks in advance for any help :slight_smile:

Edit: The mark should only be applicable to targets in front and within approx. 1 meter

this should be a pretty simple thing to do though there will be a few things to consider as well.

first i will explain how to accomplish this as youve stated. the first thing covered will be setting the teleport target (shift 2), i used a function here so it can be reused (see capture1 below). also my function has a input parameter index which will be the number your looking to press. to set the marks location you will need to use a trace to locate the actor to target. for the locations of the trace i used the players location as the start point and since i wanted to trace 500uu forward i got the forward vector, multiplied it by 500, then added the result to the players location. you may have a different method to determine these points based on your game. the last step is to set array element for a array variable. the array will contain the locations of all the marks you have active. you may also want to add in a branch node before the set array element, currently if you press the set mark button but miss a viable target the array element will be cleared, so add the branch if you want to avoid clearing the index (i can explain how if you need).

the next thing will be teleporting to the mark (F2). this is pretty simple as well you just need to get your array then get the appropriate index which will return the actor in that index. you then get the actors location and use the teleport node.

the last thing is to clear the mark which can be done by just getting the array then setting array element and not providing a item.

now for the additional consideration, since you are targeting actors and getting the actor location you may run into the issue where the actors origin point is in a undesirable location. for example when testing i targeted a mountain and when i teleported i ended up under the landscape. to avoid this theres two solutions i can think of, either use a vector location instead of an actor or create a system which spawns an actor (marker) then attaches the actor (marker) to the target. if you use the vector location method you will have static locations which could be an issue for you as the location in the array will not move with the target character, but this will avoid the spawning at target actors origin. if you use the spawn actor method it may be a bit more complex to implement but it should work well exactly as you want. so its something to consider.

if you have further question let me know.

ok it was actually much simpler than i was thinking it would be to use the method where you spawn an actor and attach it to the target. see below pictures for an example. i also added in some control to limit how often you can teleport at least thats what im thinking you intended.

Thanks for taking time do this it looks amazing! :slight_smile: