Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: anarcy on August 05, 2013, 04:35:04 AM
-
Hey guys im fairly new to playmaker and loving it.
So my problem is i have a spaceship but for reference sake lets call it just a flat plane i want to make it rotate a small distance in the axis in a top down way so only 2 axis x and z.
__ ...> \ or / ...>__ vise versea
i have tried getting both axises separately but that just continues to rotate and if im constantly updating the rotation i can make it go back to 0 / 0 / 0.
how can i get the direction of the axis and then tell it to rotate say "20" in that direction then on button up rotate "-20".
thank you :D
-
Hi,
ok, one way is to use the "Set Rotation" action, and have the values that you inject to be dependant on the input down and up state.
I have made a small working example showing how to rotate a cube based on mouse down. When the mouse is up it goes back to 0.
I use here Lerp for smooth animation, but you may want to simply set it, in that case, simply inject directly the rotation target in the "Set Rotation"
If you have more questions, don't hesitate.
Bye,
Jean