Portal teleportation fail

Godot Version

4

Question

my portals keep teleporting me to the incorrect destination, its putting me where there isn’t a marker point and its putting me outside of my game, i followed the youtube video here https://www.youtube.com/watch?v=YT5ZE0a4YtU&t=266s, but mine dont seem to work the same way and i cant find what i did wrong

extends Area2D


func _on_body_entered(body: Node2D) -> void:
	if body.is_in_group("player"):
		body.set_position($"Maze2".global_position)

I’m not sure but you are setting a relative position to a global position I believe.

1 Like

well its teleporting me 6 cubes in a 45 degrees up and I’ve tried making it not a global position and it does the same thing but down

I mean body.set_poition being relative could screw stuff up. If you try making that a global position instead.

2 Likes