[SOLVED] Collisions Destroy Scene Not Working

Hello! I am new in Playcanvas and in coding.

I wrote this code so that the scene will change whenever my player collides with an asset. It worked several times before. I left the project for a few days and came back, but when I launched my game, the code isn’t working anymore. What seems to be the problem?

Game Link: PlayCanvas | HTML5 Game Engine

Thank you so much!

Hi @Rovic and welcome!

I found two problems in your script.

On line 5 you use Collisionstart instead of collisionstart and on line 15 you use Modem instead of MODEM.

Apart from that, there is an easier way to change your scenes.

All you need is the line below.

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

It works! Thank you so much!

1 Like