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 help is appreciated.
Develop games in your browser. Powerful, performant & highly capable.
Off hand you could try the rotate method I used in this topic.
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)