# Game Over and Key/Door Relationship

**URL:** <https://forum.defold.com/t/game-over-and-key-door-relationship/13413>\
**Category:** Questions\
**Created:** [November 7, 2017, 1:39am UTC](https://forum.defold.com/t/game-over-and-key-door-relationship/13413 "2017-11-07T01:39:00Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![FredRide32](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/f/5daacb/32.png) [@FredRide32](https://forum.defold.com/u/FredRide32)\
**Post date:** [November 8, 2017, 6:28am UTC](https://forum.defold.com/t/game-over-and-key-door-relationship/13413/12 "2017-11-08T06:28:13Z")

</div>

Both scripts I have showed you are part of the same player script (attached to the player object). Should I have a separate collision script for the player? PlayerCS is the name of the kinematic collision object that I assigned to the player.go character.

In the script, the first “on\_message” was from the link below where you helped with the collisions for the walls (which worked by the way) but they bypassed the “group” and “mask” relationship. As in, any group not named “wall” or “player” would not get triggered.

the second on\_message defines the reset function and the final one tells me to reset the player. Should I have only one on\_message and have the rest in on\_update?

As you posted in here [Collision detection - #6 by britzl](https://forum.defold.com/t/collision-detection/699/6) here is my entire(?) project [gamefiles\_goat.zip](https://defold-forum-bucket.nbg1.your-objectstorage.com/original/2X/e/e1196a37d82c6c0878775126dc3c9830ef9dd2f0.zip) (4.6 MB)

---

_[View the full topic](https://forum.defold.com/t/game-over-and-key-door-relationship/13413)._
