Jittery hover state when mousing over button

0 favourites
  • 4 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.
  • Hey all, been trying to puzzle this one out but haven't figured out a great fix.

    I have a button that I'm trying to add a depression effect to on rollover using tweens.

    It works okay, except when the mouse comes in from the top, if you hover near the edges, it goes a little crazy and jitters up and down and repeats the associated sound effect. This doesn't happen when the mouse enters from right, left, or bottom. I'm assuming it has something to do with the button starting to move down slightly, and thus out of the mouse over range, and it just confuses the whole thing?

    I guess worst case, I could just replicate the effect with a simple animation, but any ideas on how to fix it using the current approach? Thanks in advance!

    Here's the .c3p with the example

    Tagged:

  • And sorry, just to clarify...the button is a sprite object with a tween behavior applied, not an actual button object.

    Quick screenshot of the sample event sheet, for reference:

  • Use another sprite X. You can spawn it at the same position and use the same size as your button; also make it invisible.

    Your cursor should be over object X instead of the button, and if yes... then tween the button. boom

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Simple and elegant, worked like a charm. Thank you for the assist!

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