Touch thumbstick movement with object 'ease'

0 favourites
  • 10 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hey guys,

    I found some topics for thumbsticks here on the forum, but I'm actually looking for one where the player object has 'ease' (I think that's what it's called) movement. Like in real life, a car can't do a 180 degrees 'flip' when you move the direction of the thumbstick opposite.

    So basically, I'm looking for that thumbstick code with the moving and static part, but where the player object moves like a car with a say, minimum turning circle. So it doesn't steer around its own centerpoint. If that's possible of course.

    Hopefully I got my point across, I'm not sure how else to explain it.

    This is the template I use in C3: howtoconstructdemos.com/virtual-thumbstick-to-control-a-character-with-8-direction-behaviour-capx

    Maybe there are simpler versions somewhere, and for C3. Well, if you can help me out that'd be great!

  • You can disable event 14 in that demo and enable "Simulate Controls" group. Also, set small acceleration and deceleration values in the Player's 8direction behavior - player will start "drifting".

    Another option would be using Car or CustomMovement for the player.

  • dop2000 Thanks for your reply.

    Yes, unfortunately the '8 direction' isn't what I was looking for , I really liked the 'smooth' 360 degree movement as opposed to the 'arrow key' movement.

    I tried the Car behavior, but the Player object is still able to do that 'flip' with the example I tried.

    One thing I just noticed now is that the Player object also auto-rotates to the closest of any 8 directions if you let go of the thumbstick. Is it possible to make it 'continue' in the direction when the thumbstick was let go?

    Hope I'm not asking for too much. I'm trying to figure out it myself, but there are so many options to try in combination with others, I don't know what to do!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try this one:

    dropbox.com/s/9z0t05t4bw5ozgs/Thumbstick_car.c3p

    I also updated the thumbstick code, should work better now.

  • Hey thanks, that's really nicely done! I probably should've mentioned I tried to make controls for an airplane. Initially I used bullet behavior for the Player object, so it would always fly at a minimum speed. But I ran into the 'flip' and another issue, what do you recommend I use for airplane controls?

  • You can try Car behavior with "Simulate accelerate" executed on every tick. And only steer left or right with the thumbstick.

  • Thanks man!

    Works great, I set the 'Drift recover' to a high number so it doesn't drift anymore.

    Code edited to this from your example 'Thumbstick_car':

  • Hey dop2000, I tried your example on my phone, but I can't move/use the thumbstick. I tried tapping the screen a few times and adding an extra layout before it, but it just won't respond to touch input. Buttons and such that I added work fine, but your example only works with mouse input. How to fix it?

    Thanks!

  • I tested my example on android phone just now and it works fine. Did you make any changes to it? Check that you are not using any Mouse expressions.

  • Hey yeah you're right! Weirdly enough, my own project works fine now as well. I didn't change anything. I tested on iPhone 7, Safari browser. I don't know what went wrong, my apologies!

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