# playMaker

### Author Topic: Math Rotation help  (Read 1721 times)

#### nabilfx

• Full Member
• Posts: 186
##### Math Rotation help
« on: July 05, 2015, 04:27:30 PM »
how can i use a math operation, to measeure the rotation angle, and fire events at specified rotation angle? help please

#### DarkSoul

• Playmaker Newbie
• Posts: 37
##### Re: Math Rotation help
« Reply #1 on: July 05, 2015, 08:40:28 PM »
Hello,

Rotation depending on what pressinga a Key? Or gameobject rotation?
Can you be specific on what you want , Explain you idea in more than a line so we could help you.

#### nabilfx

• Full Member
• Posts: 186
##### Re: Math Rotation help
« Reply #2 on: July 06, 2015, 08:31:27 AM »
Is like a pendulum, the object has gravity, when it begins to rotate to the right, a button applies force to the opposite side, and so on. The position in the picture must have a value of 0, and the limit on the red line value 100 to one side and -100 to the other side. when the game time runs out, will trigger a specific event depending on the position. Understand?

#### DarkSoul

• Playmaker Newbie
• Posts: 37
##### Re: Math Rotation help
« Reply #3 on: July 07, 2015, 06:19:35 AM »
Hello,

Hmmmm , Sorry it took me quite some time to answer
It was challenging to make this work , I tried rigidbody it couldn't work for it ,
But I made this using I same scene as you [simple primitives ] and I created a empty gameobject and but it at cylinder position and parented the cylinder and the cube to it , it has become like an anchor , when you rotate in z , it rotates perfectly around it like a speed meter ,

Now I have known What I need to do [Keep playing with actions to rotate z ]
I tried all float animate values but no use , I ended up using [I Tween Rotation Add] it adds 10 Degrees to left or right according to a KickStarter State I started with .

And when it reaches 90 degrees or -90 degrees the player lose [it doesn't matter what in the gui 90 or 100 I am talking only about rotation].

And using A , D Keys the player can prevent the thing from reaching that point , by subtracting in the opposite direction .

The KickStarter State is just a state with [Random Float value , ease float , set rotation]
So the player get a different result every time he hit play .

I hope this helps.

« Last Edit: July 07, 2015, 06:36:54 AM by DarkSoul »

#### nabilfx

• Full Member
• Posts: 186
##### Re: Math Rotation help
« Reply #4 on: July 08, 2015, 04:07:06 PM »
i did not get it!