Monday, July 29, 2013

Dropping Problems

The Following Is A Duplicate Of My Forum Post:  Original Link

This has me confused.  I currently have the game set up where the player can pick up civilians (the man in the green shirt) by pressing the "S" button.  If you press "S" again, you drop them.  Seems pretty simple.

Everything is working great except for situations where the player is flying fast and on the "S" button being pressed, the civilian just plays their falling animation and continues to stick to the Player.

I've recently changed a little of the game by making it possible to also catch an NPC that is falling through the air by only flying into them and not needing to press S.  To stop from automatically catching the civilian when ever the player is in the air and drops them, I have set up a FallCounter that is triggered every time the civilian falls.  A civilian must be falling for at least 2 seconds before "automatically catch on collision" can be triggered again.

Not sure if that explains it properly.  To see what I'm talking about (the picture above), press S to pick up the man in the Green Shirt, then press the "F" key to fly.  If you hold in the "A" button you'll fly faster.  If you hit "S" while flying faster, the Civilian won't drop.  He'll only play his falling animation.


No comments:

Post a Comment