Get player location > add 400 to Z value(leave X and Y 0.0) > plug the result to Destination Location of the Teleport node.
Hi,
I can’t figure out how to make a Blueprint script that would teleport the player pawn, say 400 units in positive Z direction, regardless of what the values are on the other two location axis.
What I am trying to achieve here is enabling the player to ‘leap’ through floors of a building independently from horizontal movement.
How do I do that?
Thank you in advance!
Thanks for the answer! What kind of node would you use to “add 400 to Z value”?
I hate to be that guy, but where did you get the middle node from?
I guess something like this:
(: It’s no problem to be that guy. You click the yellow “Return Value” of the left node and drag it into the EventGraph. Just to an empty place. Now a window pops up. Here you type what you are searching for. In this case “Vector plus Vector”. A normal “+” would also be enough, you should see “Vektor + Vektor” and “Vector + Float”. Just click on “Vector + Vector” and the node appears (:
Thanks a lot, guys, problem solved. I’m now teleporting like it’s no one’s bussiness!
Maybe also interesting for the future: All types have this kind of math nodes. If you don’t plug something in you can always set the variables manually (hardcode them).
Especially float, vector / rotator have some very interesting functions including interpolation, forward vector, rotator between two points and a lot more.
And also keep in mind that you can use all kinds of logical expressions for bools (OR, XOR, AND, NOT, etc.)