How to 'kill' player by moving ceiling

I have a ceiling that is slowly lowering toward the player, but I’m not sure how to go about killing the player once it collides. I also don’t want it to kill the player if they jump and can touch the ceiling before it ‘crushes’ them. I’m not the greatest with coding, so any sort of help would be appreciated! :slight_smile:

If you are a novice at programming, learn how to do it first.

For your problem, I would suggest the following :

  1. Add a collider to the ground, the ceiling and your player
  2. Add a script on the ceiling where the OnCollisionEnter is defined
  3. When a collision is detected, get the distance ground - ceil. If the distance is less than the height of your player, kill him

Don’t ask me to explain more, Unity provides great tutorials to teach you all this stuff.