Is this a bug of my making, or C3?

0 favourites
  • 10 posts
From the Asset Store
Make your own platformer for both the web and mobile easy with this Santas Platformer Template, FULLY DOCUMENTED
  • Hi all, I've got a weird bug happening. I've set up a player death animation, and I set spacebar to toggle the Player.Dead variable for testing purposes. It's acting inconsistent. If I re-arrange the order of the commands it acts different. But sometimes it will behave differently even without re-arranging the commands.

    I made a video showing it in action. There is no sound. Sorry if I go to vast when showing you the logic - I should have taken more time there, so please pause it if you need to read through it.

    Video is here:

  • It's very hard to help from videos or screenshots. Sharing your project is the best way to have this investigated.

  • It's very hard to help from videos or screenshots. Sharing your project is the best way to have this investigated.

    Sure, thanks! Here's the file. ... roblem.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Behaves consistently for me, no matter the order of the events.

    When player is "dead" you are setting his vector to upwards every tick, so he never gets around to falling back down.

    The only way he falls is if you hit space twice to toggle the dead state again. In your video you were probably getting inconsistent results because your condition was "space is down", so that would toggle on and off every other tick. Basically if you didn't let go of the space key within one frame, the dead state would toggle off again. In the example file you uploaded it looks like you corrected this already.

  • You're right, I did change the Space is down vs Space is pressed thing after posting the video - so that should fix the consistency of it

    Why is he floating away, though? I didn't mean to set it for every tick. Keep in mind that I'm super new to this, so it's probably the dumbest question in the world. But I don't see it set to "every tick."

    Thanks for your help!

  • The entire event sheet will run once per tick. If the conditions are true, those actions will run.

    The exception are triggers (green arrows) which only run once when triggered. You can turn an event into a trigger by adding the "run once while true"condition.

    Edit: here are two very useful articles you may not have found. ... nd-gotchas

  • Thank you very much for your response! So, in this case, I need to run the event "Player Is Dead" only once, right? I can't seem to figure out how to do that. Do I set it "every tick" and then invert it?

  • Sorry it was actually "trigger once while true", not run once while true. You can find it in system conditions.

  • Thank you! Got it working I appreciate your help on this, simple as it was!

  • you need to replace "key "space" is down" with: "key "space" on pressed"

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