My game has pressure plates. They’re basically just a trigger. OnTriggerEnter, the player has stepped onto the plate. OnTriggerExit, the player has stepped off the plate. This all works great.
In addition to this, I have Blocks - big chunks of rock that a player can place on a pressure plate to keep it down. This also works fine.
What doesn’t work–
If there’s a pressure plate without a block on it:
- Step on (Enter fires).
- Step off (Exit fires).
If there’s a pressure plate WITH a block on it:
- Step on (Enter fires).
- Step off (Exit fires).
BUT
If there’s a pressure plate WITH a block on it:
- Step on (Enter fires).
- Pick up Block.
- Step off (Exit does not fire).
The Block has its own collider, but this never touches the pressure plate collider.
When the player picks up the Block, it gets parented to the Player transform. Other than that, nothing much really happens.
transform.position = new Vector3(transform.position.x, 0.5f, transform.position.z);
transform.parent = Player.instance.transform;
So, can anyone think of a reason why this might be preventing the Exit event from occurring?