Tracking the head


I would like to track the head of my player in my level. So if they crouch three times, stand still for two seconds and then crouch again two times (or something that ressembles this), an event is triggered. The problem is, I am not sure how to do this and how to check that the player is actually crouching.
For now, I have been trying to put a box collision below shoulder level and check if the head is colliding with the box (the problem with this is that a child or a small person would be colliding with the box all the time). I have also been trying to track my head’s speed on the z axis to see if it is going up or down. But I can’t seem to make it work.

Do you have an idea?

You could have your player “Calibrate” himself by standing up at the beginning of your game, and then using that value to determine whether or not they’re crouching depending on the precentage they are between the floor and the calibrated stand up position?

Thank you for your help LogierJan. I can’t make it work for now, so if anyone is interested by this matter, I’m going to track my hands instead and track if they collide with a box collision put slightly above floor level, and have the players put their hands on the floor.