How to make a teleporter (Two Nodes)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By HarryCourt
:warning: Old Version Published before Godot 3 was released.

Hey, I want to make a teleporter, what will happen is that the NodeA, once collided with a KinematicBody2D w/ StaticBody2D, it will teleport to NodeB. Any way I can do this? Many thanks.

:bust_in_silhouette: Reply From: websterek

It’s sounds simple. You just need to change global pos of your kinematic body to global pos of NodeB when NodeA emits signal “enter area” or something like that.

get/set global pos: Node2D — Godot Engine (stable) documentation in English
area node: http://docs.godotengine.org/en/stable/classes/class_area.html

Hey Websterek!

Sorry for the late response, but could you get me a little bit of sample code or a small tutorial to push me in the right direction? Many thanks!

HarryCourt | 2017-08-20 02:34