Locomotion

Teleporting



Add NAC meshbound volume in scene
Create BP Characte, name as TeleportingCharacter

Set capsule size to 1 to 1, Disable gravity
In Character Movement component, set gravity scale to 0
image.png
Set camera, motioncontrollers, same as fly thruster

In event graph, create TeleportArc function, add 2 variables input:
image.png

Add ForwardForce local variable with value 500,

Tracechannel static set follow nodes (to predict where it goes):

image.png

To draw the trace arc and destroy previous after move:


Add SplineMeshes variable and Paths local varialble, continue the graph:
image.png
image.png

Continue after clear, change details on Add Spline Mesh Component”
image.png
Continue (connect Add output to Set Start and End)
image.png

Set if the teleport can go to destination, if not, the nearest can go:


Back to Predict Projectile node, connect as follow (add new variable vector teleportlocation)
image.png
image.png
Continue as follow:
image.png


Add a New Function called ClearArc (to remain the arc after teleported, don’t let it stay in previous spot):


Set graph used in Teleport Arc:
image.png

Go to Event Graph, keep Event tick node:
Add inputactiontriggerleft/right nodes, add following variables:
image.png
image.png
On Event tick node:
image.png
Duplicate on right hand, connect to sequence 1, change follow nodes:
image.png

Drag character BP in scene, set player to 0
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.