Dropping Problems

0 favourites
  • 5 posts
From the Asset Store
Now you can drop everything in your game with sound :)
  • Ben<img src="https://dl.dropboxusercontent.com/u/56104169/Dropping%20Error%207-29-13.jpg" border="0">

    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 pictre 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.

    Thanks for any help you can give.

    Capx File

    Ben

  • Wow o_o I suggest you get an animation manager for each object.

    Instead of starting or stopping animations within other actions, create events that only pertain to the animations and make each animation happen in the order of importance. I'll show you an example from a game of mine.

    <img src="http://puu.sh/3OFFi.png" border="0" />

    This ensures that only one possible animation from this object can be playing at any given time, and you have all of the animations that will ever play for the object right in one spot. They will happen in importance from top to bottom, so if you have a falling animation, put that above the walking and idle animation.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I had a similar system to that earlier, but I think I was running into some weird frozen animations and such because of the carrying mechanic. I might try and streamline it in the future.

  • It's probably the disabled 'else' in event 71. Without the else then when you press 's' it drops the civilian and then immediately catches him again.

  • Thanks, ramones ! That was an easy fix. I'm not sure why I had it disabled in the first place. Still, it seems odd that the problem only happened when I was holding down A. Thanks again.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)