Trying to turn a scene into a different scene when clicked (and back again)

Godot Version

4.3

Question

I have two scenes, object1 and object2. The goal is for object1 to turn into object2 when clicked by creating object2 as a sibling and then deleting itself. and vice versa.
This works fine for object1 but when object2 is clicked, the game imediately crashes stating there being a problem with the line that decides it’s position despite having (seemingly) identical code to object1.


the crash

preload can create a cyclical dependency, Godot currently solves this by silently failing to load. Using load instead should fix the issue.

1 Like

Yes that’s it! Works as intended now.
Thanks :smiley: