October 11, 2022, 4:13pm
Hello, as I was finalizing our game, I ran into an error where it said " Uncaught TypeError: Cannot read properties of undefined (reading ‘on’)".
Attached below this paragraph is my character next to an object that they should have collided with, yet the collision or like the interaction between the character and the object never happened.
Here is a screenshot of what the error looked like upon launching.
And here is a screenshot of where the error takes me to in my script. I am not sure what it meant when it cannot define ‘on’.
Some sort of enlightenment or help would be very much appreciated. Thank you!
@Ramm! It looks like your entity has no collision component. You can check this in the editor.
October 11, 2022, 4:52pm
Thank you for your response. But my character and the entities its supposed to interact with all have applied collisions.
Attached below is a screenshot of the character’s settings panel.
I think it can also be that you destroy an entity while the event listener is still active.
October 11, 2022, 5:36pm
I am aware that the entity is the object I am supposed to collide with but which part here is the event listener?
Do you destroy an entity by script? If so, please check the manual page below.
October 14, 2022, 11:25am
I read and tried to troubleshoot with the help of peers and it seems that an issue could be that the script isn’t attached to the entity, yet, when I checked again, it is applied. In fact all entities that trigger the event have collisions attached to them so I am unsure anymore on what to do.
I am actually bit afraid to readjust the script because this is the only running issue left on the game and I don’t have enough time to troubleshoot it. If it could help further explain my issues, I will be linking the game below. Thank you in advance.
October 14, 2022, 12:01pm
This entity (‘DLG BOX’) has the collision script but no collision component
Found this via the Smart Search tool that can search for entities that have the script attached to it
October 14, 2022, 12:58pm
It worked! Thank you so much. This helped me a lot in my project.