(Issue) Slider cursor keeps reseting to the start when dragging it

0 favourites
  • 6 posts
From the Asset Store
Mouse cursor is something that the player controls and sees all the time, that's why it is so important to make it cool!
  • I'm having an issue with my slider cursor - Ever time i drag it across, it keeps reseting back to the start rather than stay where i let it go.

    Another issue is that if i tap anywhere on the slider, the cursor goes and stays there (which is fine). But when i tap the cursor again, it goes back to the start.

    There was a post created where a user had asked for help in creating a slider, i've used the example from that post for mine. Apologies but, despite trying, i can't find that thread in order to give credit to the user who helped out.

    Two issues that i need help fixing:

    - Slider cursor keeps resting when dragging

    - Slider cursor goes back to the start after tapping for 2nd time.

    Project file: https://www.dropbox.com/s/co16loyhqwlzqv4/Slider%20Test.c3p?dl=0

    Really appreciate any help fixing this.

    Thanks

  • Get rid of the "Set X to clamp..." on Drop - the touch coordinates reset to 0,0 if you aren't touching any more.

    I'd also get rid of the Waits - I see no reason for them, and are likely to cause more problems then they solve.

  • Thanks, tried that at it does solve both my issues.

    However, i've now found another issue.

    If i drag the cursor outside of the slider and towards the edge of the layout (or off the layout) the cursor goes along with it and doesn't stay within the slider bar.

    It didn't do this unless i remove 'Set X to clamp' on drop

    Any ideas with this?

  • I don't see that, when I make the change here. Repost I guess, to see what's different.

  • Here's the amended project: https://www.dropbox.com/s/bkoo7ctg41ica8t/Slider%20Test%20v2.c3p?dl=0

    I've also provided a GIF to show what i'm facing:

    https://media.giphy.com/media/duXUci3PJhHuxyPQ3g/giphy.gif

    It's a bit hit and miss to recreate the issue. I've found that you need to drag across with a bit of speed to recreate the issue, if that makes sense?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I did see it once, but it is really hard to reproduce. One thing I've done in the past for this kind of drag object is to use an invisible helper, rather than manipulate the object itself, since you are fighting against the DragDrop behaviour, that is trying to set the X value, but then you are resetting it when clamping. So clamp to the helper object, but don't change it's X, which could cause odd issues.

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