# playMaker

### Author Topic: Rotating a wheel with touch[SOLVED]  (Read 2473 times)

#### spiralKing

• Junior Playmaker
• Posts: 50
##### Rotating a wheel with touch[SOLVED]
« on: February 05, 2014, 03:48:51 PM »
I have a wheel that I'm trying to rotate with touch, but not just flicking or swiping it, it has to have a circular motion

e.g.

In addition to rotating, I need help figuring out how to get the wheel to pop to specific positions

e.g.

Imagine a 12 hour clock; I'm rotating a wheel with points that align with the numbers (12, 3, 6, 9) on the clock

Say if my finger rotates one of those points on the wheel from 12 to 3, maybe I don't actually reach 3 but if the point is closer to 3 than 12, I want it to pop to 3 or pop back to 12 if it's closer to 12

That way whenever I rotate the wheel it always pops to one of those numbers (12, 3, 6, 9) after I let go, depending on which number the point on the wheel (the point the finger is touching) is closest to
« Last Edit: April 10, 2014, 09:58:14 AM by spiralKing »

#### MeachWare

• Playmaker Newbie
• Posts: 43
##### Re: Rotating a wheel with touch
« Reply #1 on: February 05, 2014, 03:59:24 PM »
aka tween +90 degrees

#### escpodgames

• Hero Member
• Posts: 677
##### Re: Rotating a wheel with touch
« Reply #2 on: February 05, 2014, 06:26:08 PM »
In Super Monsters ate my condo we made it play an animation of the wheel spinning when the screen is swiped BUT atm I'm making another and would be cool to have it based on how hard you spin. CHECK OUT THE VIDEO!!!

What I'm thinking of doing is creating the same spin animation but have a loop section that is fast (360 deg spin) then depending on the velocity of the swipe  it will play X amount of times and then play the outro of the wheel slowing down. While all this magically animation is happening I also rotate the wheel so it will land on the section I want (selected with another system). In monsters ate my condo we had 2 outro animations also, one so it would ping back and one forward ... this was so you wouldn't know which prize you were getting (like most real wheels)

How to rotate the wheel before the spin animation happens is something ill need to play with.

#### spiralKing

• Junior Playmaker
• Posts: 50
##### Re: Rotating a wheel with touch
« Reply #3 on: February 06, 2014, 06:36:20 PM »
LampRabbit

No offense but how exactly is this supposed to help me?
I posted here asking for help to my problem, instead you highjack my threat

uncool

#### MeachWare

• Playmaker Newbie
• Posts: 43
##### Re: Rotating a wheel with touch
« Reply #4 on: February 06, 2014, 07:04:27 PM »
Watch the Playmaker YouTube vid about tweening. There he makes a cube move on just one vector. Your tween would be similar except your rotation is on the "y" axis. It would be easier to get the tween functioning with a click or button tap first, then switch to a touch.

#### escpodgames

• Hero Member
• Posts: 677
##### Re: Rotating a wheel with touch
« Reply #5 on: February 06, 2014, 07:20:45 PM »
@spiralKing

I was sharing my experience with making a wheel and what I plan to do on my next one, if the iTween tutorial doesn't enlighten you, I'd be glad to help.
« Last Edit: February 06, 2014, 09:32:31 PM by LampRabbit »