How Would I Make a Steering Wheel?

0 favourites
  • 3 posts
From the Asset Store
Awesome drifts on auto generate way,tap to steer right.
  • I'm trying to figure out how to make a steering wheel.

    I've thought of setting the angle to where I touch, but that just makes it jump to the position, and I've tried using how far I've dragged the touch but then the action is the opposite direction on the other side of the wheel.

    Any ideas?

    Any help is appreciated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Off hand you could try the rotate method I used in this topic.

    construct.net/en

    There may be other topics that have ways to rotate knobs that may help.

  • For this to work, you will need a variable to store the angle offset of the start of touch :

    When the touch starts, you calculate the current angle between your wheel and the touch. Let's call this Alpha, Alpha = angle(wheel.X,wheel.Y,touch.X,touch.Y)-wheel.initialAngle

    (wheel.initialAngle is the angle of the wheel when the touch starts)

    Then, while the touch is active, you set the sprite angle to angle(wheel.X,wheel.Y,touch.X,touch.Y) - Alpha

    This will make the wheel follow the touch (as the current angle will change just as the touch angle changes), and when the touch starts, the angle will be set to Wheel.initialAngle (so it won't jump to the current touch angle)

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