Collision detection doesn't work

Hi @Joy,

Thanks for sharing! I’ve looked through your code and noticed that you’re trying to set set two collision event handlers on the enemy items. Please keep in mind that only one collision handler of a particular type can be active at the same time.

Please take a look at this answer from another thread to see how event handlers work in CoSpaces :slight_smile:

There are two solutions for your problem:
a) Set an event handler on the camera item and check if the item which the camera collides is one of the enemies.

b) Add the game over - logic to your movement script.

Below you find an improved version of your pac man space. Check out the scenes “solution a)” and “solution b)”. Click the remix button to copy the space as your own and check out the code!

1 Like