Flickering between animations

0 favourites
  • 11 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Hey, I'm playing around with a platformer and when my player lands on a platform it flickers between the falling animation and the idle animation. Here is my event logic:

    Its probably obvious to you guys, but I am a little confused here.

    Thanks in advance.

  • From where you set all your animations, can you try add "else" to the second and third subblock at event 11 and 12 respectively? Is the flicker still present? Is there anywhere else you are setting animation?

  • Done, here is the new event list, however the same thing still happens :/

  • Do all those animations have the same hitbox size for all frames? Where are their hotspots? Show them all.

  • It is likely indeed the collision box issue.

    If between a frame and another of the idle animation the collision box is smaller, Construct will consider for a few tick that the object is falling, and will switch to the "Falling" animation.

    Once on the Falling animation, if all the hitboxes are the same appropriate size and close enough to the ground, then Construct will consider the object has landed and is on the floor, and will switch again to the "Idle" animation.

  • Okay so each frame is 96x96 in size, (a large buffer window since i'm not rendering large weapons) They are all centred at the bottom of this graphic like so. The hitboxes are like so:

    Idle:

    Falling:

    The head positions are a little different however the base hitbox is always the bottom of the graphic. (The 96th pixel)

    Edit: Just realised I messed up the cropping of the 1st image at the top, my bad.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Don't use a single pixel on the ground, prefer to have at least two that will make a proper line.

    Then, make sure the alignement/distance between the origin point and this "ground" is the same on all frames.

  • Right, I was thinking it was a little funny, I was basing it off the "guess polygon shape" feature and I assumed that was the way to do it. However its still doing it with the improved hitboxes:

    Idle:

    Falling:

  • Make sure the origin point is placed at the same position on each frame.

    Otherwise post your complete capx so we can investigate further.

  • I think event 10 should be 'on jump'. As a top level event, no sub.

    12 should be (no sub)

    Is on the floor

    Is moving

    or

    is on the floor

    compare two values ... abs(sprite.flatform.VectorX) .. > ... 1 (rather this)

    13 should be (again no sub)

    Is on platform

    compare two values ... abs(sprite.flatform.VectorX) .. <= ... 1 (rather this)

    Because jumping/falling/landing = moving

    Look a second at my example in here

  • by setting all origins to 48,96 It now works! Thank you for your help

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