Game doesn't go to the ending scene

I am using PlayCanvas as my medium for my final project and I am currently under an issue where I have a specific script that lets the game move to another scene if it reaches these conditions.

This is the script that allows my character to collide with different objects in my game and have certain endings.


The endings are divided into 3; completing 4 tasks, completing 4 pastimes, and completing 2 of each. The error mostly occurs when the character completes or has already collected 4 tasks.


This is what usually pops up when that error occurs.

If it might help, here is a link to my project. Thank you.

You have a trailing space at the end of ‘03 End Scene 1’ in the Editor:

Remove that trailing space and you should be fine


You never fail to amaze me how easy you fix the issues we have in our project. I hope your days are always great, yaustar! Thank you so much!