Detect if the player is getting crushed/stuck between two collisions

Years late, and no reply, so I’m just going to write for anyone else who stumbles upon this:

Usually, you fake this sort of thing, and it’s not something that you realistically code for.
In the example that you mention of the player standing on a cube and being pushed into the ceiling, what I would do is have a Box Collision component as part of the moving cube blueprint that is placed at the ceiling height (either manually, or relative to the maximum height the cube will travel) and when the player overlaps this, you kill them. You just assume that the player is going to die instantly once they are crushed. Alternatively, if you wanted to code a system where the player can maybe push back against being crushed, or escape, then you’d want to just apply damage for every X time that the player is overlapping the box collision. You’d use an Event timer for this.

1 Like