0 votes
extends Area

export(NodePath) var teleport_enter = null

func _on_Teleport1_body_entered(body):
    if body.is_in_group("teleport_player"):
        get_tree().call_group("teleport_player" , "teleport" ,get_node(teleport_enter).transform)
        print("teleport")

func _on_Teleport2_body_exited(body):
    if body.is_in_group("teleport_player"):
        get_tree().call_group("teleport_player" , "teleport" , get_node(teleport_enter))

and player

func teleport(target_pos):
    transform = target_pos 
    print("ok")
asked Apr 26, 2019 in Engine by m5ables (18 points)
edited Apr 26, 2019 by m5ables

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.