![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | RowingNoob |
So I’ve made a “Portal” type thing, that when the player enters it it changes scene.
Here’s the code for it. I’m using GDScript
extends Area2D
export var NextScene: PackedScene
func _on_Portal_body_entered(body):
if "Player" in body.name:
get_tree().change_scene("NextScene")
For some reason all this does is just restarts the scene, and I have changed “PackedScene” to the scene I want it to go to. Please help I have no clue why this is happening, I even tried copy and pasting somebody else’s code, and they said their code worked for them.