Script Is Disabled After Running Retry Function

Hello all,

I have tried to make an update to my game with a retry button. When I lose, then win the race after retrying, the collision detection script ceases to work. Any reason for this?

https://launch.playcanvas.com/843343?debug=true

How did you implement the retry button?

Resetting your scene state/entities to their initial state requires some sort of state manager. That keeps track of start/end state and can do the steps required of switching between the two states.

If you don’t have a system like that in place, an easy but non elegant solution is to reload the page on retry.

1 Like

I used the state manager @Leonidas. Thanks a lot for your help.