Help on switching scenes upon collision

Hi! I’ve been to make a switch scene mechanic wherein upon collecting the item “boxRingObject” the scene switches to the scene “marriage” but after trying to work on the code, it doesn’t seem to work. Hoping for some help on this, since I also need to make it possible for other objects that upon collision/collection, it switches to a particular scene :confused:
Here’s my editor file for reference:
https://playcanvas.com/editor/scene/1982604

Hi @Yosano and welcome!

Which part is working and which part is not working?

To change the scene you basically only need the code below nowadays.

this.app.scenes.changeScene('Some Scene Name');
1 Like

Hi! What’s working is that upon pick-up the collision for the entity “boxRingObject” works and the “ring” object appears in this stead, but I also want the function of changing scenes to the scene “marriage” but that doesn’t work.