So I’m working on a game where the player has to work their way around the level, finding switches to open doors, and I wanted to add a kind of “Blink” feature, where the player would teleport a short distance wherever they were looking, however , I’m not really sure how to go about doing this. I’m using the stock first person character, with the firing of the gun removed, and the gun and arms hidden.
The type of system you would need to implement would depend on your desired functionality. If you want the player to teleport to a point that they are looking at then you may need to use ray traces; however if you just want them to “blink” ahead a short distance in their forward direction you should be able to get away with just setting the transform of the character relative to its current transform in the direction of the actor’s forward vector. There are a number of ways you can do this an I’ve included links to some likely nodes below; however, feel free to experiment and find the best way to achieve your desired result. Hope that helps.
See:
GetActorForwardVector
AddWorldOffset
Hello KattJessus!
Here is how I would handle it. Inside of the FirstPersonCharacter blueprint find where the LineTrace is cast and try this out. If you also want to be able to blink through multiple elevation levels you would take the z from the break vector use a + node to add your character height to it, and then run that into the z of the make vector. Let me know if this helps!
Full Res: http://i.imgur.com/GevyhYH.jpg
Out of curiosity(since I’m new to this program) what do you have entering the “LineTraceByChannel” node?
Unless you are doing VR like I am, you would just need to get the Location and Forward Vector of your player cam.
What do I use to get those locations, I’ve tried looking, but I can’t find the required function.
Here is how to use a line trace by channel with a single camera, MaxRange is just that, the maximum distance I want to trace to, saves a bit of cpu time not line tracing into the abyss. I think this one is set to 10,000. But a good thing to do is the check the maximum distance you can fire in your level and set it to that.
well then, thanks for the help, but final question (hopefully) what function do you have for the player input, as I tried to add it for the player clicking, but the function did not work
never mind, seems I figured it out, thank you so much for all the help
Awesome, please accept the answer to make it easier for others to find in the future!
One final question(sorry for the inconvenience), how could I make it to where the player can no longer teleport after entering a certain area?
try to look for a tutorial first… here is one