Turn a Wheel with moving of a Finger (or mouse)

Hello Lovely Community,

I have been searching for a few days now through the forums and have found some information (however, most advice points towards the Gamesalad Cookbook youtube channel which is no longer about :neutral_face: ) so i was wondering if anyone had any advice on;

Getting a fixed wheel to move in relation to where your finger is at the bottom of the screen. So if your finger was placed in the middle of the screen it wouldnt move, but moving it right or left would result in the wheel spinning that way?

Thank you for reading and I look forward to learning and being able to give lots back to the community!

Thanks.

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    Just constrain the wheel's rotation to mouse X position, it's as simple as that.

    If you want the centre of the screen to be 0° then all you have to do is offset the angle of the wheel by 512° degrees (assuming an iPad size project).

    Constrain rotation to game.Mouse.Position.X - (scene size / 2)

  • joeemsliejoeemslie Member Posts: 3

    @Socks said:
    Just constrain the wheel's rotation to mouse X position, it's as simple as that.

    If you want the centre of the screen to be 0° then all you have to do is offset the angle of the wheel by 512° degrees (assuming an iPad size project).

    Constrain rotation to game.Mouse.Position.X - (scene size / 2)

    Thank you so much! Really appreciate the help!

Sign In or Register to comment.