How to solve animation/state "flickering" when player sprite is standing still on a moving platform

Not favoritedFavorited Favorited 0 favourites
  • 7 posts
From the Asset Store
State Machine
$10.99 USD
State Machine is a great tool for managing the state of anything in your game.
  • I'm encountering an issue when my player sprite stands still on top of a moving platform - the animations/states (debug text above for current state) begins flipping through between "idle" "falling" "landed" again and again as long as the player is riding this horizontally moving platform back and fourth.

    The player is also being bumped back or something as the animations/states are flickering.

    I have been trying to solve this issue for days and have tried many many combinations of failed solutions.

    Some context that is important. I have my animations as a child to a basic Player sprite that only is an invisible rectangle. I'm using the Platformer behavior on the player sprite.

    Attempts:

    I did use ChatGPT to help me try to fix this but it was no help, here is what I tried using their suggestions:

    Default Sine behavior

    • Let the platform move via the built-in Sine behavior — (flicker persisted).

    Manual platform movement

    • Removed Sine, drove X by Speed * dt between left/right bounds — (no effect on flicker).

    Basic “Platform → Is on floor” checks

    • Tried gating idle only when player.Platform is on floor = true (and inverted for “not on floor” debug) — flag still blinked.

    Velocity-threshold idle detection

    • Checked abs(player.Platform.VectorX) < threshold and abs(VectorY) < threshold before calling idle — micro-jitters still broke it.

    Platform → IsFalling inverted

    • Combined Is on floor with “not Platform.IsFalling” — still unreliable on moving rails.

    stateLocked boolean

    • Introduced a flag to lock out state changes during transforms/attacks — didn’t stop the underlying “fall” flicker.

    IdleTriggerBox pinned to each platform

    • Spawned a tiny invisible box above each MovingRail, used “player overlaps IdleTriggerBox” to trigger idle — screen still “bumped” as underlying physics fought it.

    -----

    I've seen youtube videos showing people how to setup moving platforms using Sine and I did that and yet their player is able to stand completely still, unmoved by the motion of the platform beneath them and mine is cycling through falling and landing and idling and is being pushed back from the inertia or the animation cycling. It is confirmed that the Player is not on the floor consistently.

    Really could use some help on this, thank you all very much!

  • You can add another condition to the event which sets "falling" animation:

    Player NOT overlapping MovingPlatorm at offset (x=0, y=2)

    And to the event that changes the aimation to "landed":

    Player is animation playing "falling"

  • Thank you very much for the suggestion! It is deff a step in the right direction. It's working in the sense that the animation flickering has stopped but now (and this was happening before) the entire screen seems to be bumping or jumping a few pixels worth of space. It does this exactly when the animations would have been flickering. The only other effect from you fix is that the player's running (moving Left/Right) animation is now not functioning right. It will play the run animation VERY fast and then it will get stuck on one frame and move the player around but not animate and just freeze frame it in that one frame.

    I really appreciate your help, and if you have any other ideas or sequential fixes for this new issues I'd love to hear it. Thanks!!

  • Please share your project file or screenshots of your code.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, sure thing, it's intended to be an IOS Game so you may need to click the directional arrows with the mouse and after doing that once some reason the arrow keyboard keys work from then on in play testing each time. I really appreciate you taking the time to look into this. I sent the project link to you in a Facebook message if that's okay. Please let me know if you prefer another way to send to you. Thanks! Happy to answer any questions in helping you determine the issue.

  • Your MovingRailHorzontal object has different collision masks in animation frames. So it launches and drops the player up and down all the time.

  • OMG thank you!!! I thought I had checked everything. I was modifying the players collision boxes and even took away the "masks" that animate on top of the Player object. what a simple thing, works perfectly now. THANK YOU saved me so much trouble. If you ever need a favor in some way with your games, not sure I can help with coding but maybe a graphic, let me know! :)

    ALL FIXED - of the two frames of the Moving Platform object the second frame had a slightly different collision box, once that was matched everything is working perfectly fine.

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