Dead by falling too long

Hi,

I wanted that if my player falls for a too long time that he gets dead.

So I have set up a timer when he jumps the timer is set to 0.
As soon as he hits the ground (detected by a ray and collision sensor) it is checked if the timer is above a certain time and so he will be dead.

The problem is that the timer runs when he’s on ground only too and after the timer is above the time he is dead even he doesn’t jump before. I hope you get problem.

So do you have any idea I can get this to work?

Thanks in advance

Ahhhh, I got it to work.

Just added a property “jumped_before”. So if he jumps it gets to 1 else 0.
So if only “jumped_before” == 1 he gets dead.

This will avoid getting dead if he doesn’t jump. Why didn’t I come up with this idea before.

Hi strub.

the time is not necessarily the best method to measure that. You are not dying on a long parachute jump (you would die on a very short one :wink: )

It is more important how much speed the character has at the time of impact.
To be more precise: the amount of deceleration (speed reduction) is a very good indicator.

This allows:

  • long jumps/flights/falls with smooth landing
  • high speed landing on slopes (like a ski jump)
  • landing on moving ground (jumping on a train)
  • died on impacts by other objects (knocked over by a bus)

Check the collision thread for more details.

Monster

Hey thanks a lot Monster. This is a really good point. Didn’t think of that. That would be far better than just taking the time, you are right. I will look into that. Thanks