How do I solve this touch control issue?

0 favourites
  • 3 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hello,

    I wonder if anyone could point me in the right direction. I have a small problem with touch controls. I have keyboard controls that work fine but the touch controls do not want to work. Please see these examples below. I am using tween values to give cars different turn, speed and drift values. Works great with keyboard but when applying to touch, turning left / right doesn't want to play.

    Keyboard

    If I do this with touch controls instead of keyboard it doesn't work and I am unsure why the tween will not work.

    Touch

    I have a touch object on a sprite for acceleration using the same tween behaviour that works. just the turning left /right

    Thanks in advance for any ideas you can provide!

  • The problem is likely somewhere else in your code. Maybe you have an event like "If keyboard buttons are not down -> Stop Tween"?

    Or maybe you have another action that restarts Tween with the same empty "" tag. I suggest using proper tags to identify different tweens.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks dop2000, something certainly is conflicting. I have added labels to the tweens but that didn't seem to help, after playing around and adding some Globals for left and right touch and set them to zero when they are not being touched, I managed to get some response. From there I've run down a rabbit hole. I had one turnbar to get the width for the tween e.g -200 to +200, I've added a second bar which works in as far as it responds to left (0 to-200) and right (0 to+200) touch but while the tweens revert to zero when not in touch, the global variable with the value of the width sticks (maybe because I'm not trying to set the gVariable from two different width values). All this however messes up my keyboard controls and I still don't really understand why keyboard controls work but touch requires different logic?

    In anycase, I'll stick at it and hopefully work it out. Thanks again for your response.

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