How to teleport KinematicBody to position on 3D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Lazyworker


what i want is

When my KinematicBody has touch someting
It’ll teleport to position (0,2,5)

Now I’m detect touch with body entered but try to set KinematicBody position

func _on_goal_body_entered(body):
if == “myball”:
set position to (0,2,5)

thank fo solution

You doing a soccer type game?

SF123 | 2022-04-19 23:45

:bust_in_silhouette: Reply From: Grifft

Since it’s a KinematicBody, I think Garbaj’s tutorial would work well for you.
Garbaj’s tutorial on blinking/teleport like effect in 3D

:bust_in_silhouette: Reply From: Ninfur

To set the position of a Spatial node, set its translation value

body.translation = Vector3(0, 2, 5)