playMaker

Author Topic: noob question: rotating a cube 90degrees [SOLVED]  (Read 4012 times)

NGKrush

  • Playmaker Newbie
  • *
  • Posts: 10
noob question: rotating a cube 90degrees [SOLVED]
« on: September 11, 2011, 06:16:03 PM »
okay, i'm trying to do something super simple and have it working, but not

*on mouseclick I want to rotate a cube 90degrees over the Y axis.

so I have:

[IDLE]
on mousedown
->
[ROTATE]
rotate 90(on Y)
Wait (1 sec, finish event: FINISHED)
->
[IDLE]

the cube rotates, but it doesn't do it at exactly 90 degrees. i know the wait action isn't the correct one but i couldn't find how to do it differently.

could someone help me out?
tnx!
« Last Edit: September 16, 2011, 06:42:18 AM by NGKrush »

NGKrush

  • Playmaker Newbie
  • *
  • Posts: 10
Re: noob question: rotating a cube 90degrees
« Reply #1 on: September 12, 2011, 05:46:42 AM »
so I've been trying it again with:

-itween rotate by/to
this, like rotate, starts the rotate but doesn't stop it.

then i checked the slider + GUI videotutorial from the site and saw the jumping cube, so based on that i tried using the set rotation block without any effect.

I'm feeling i have to do this (sorry, i'm not a programmer):
-get the start rotation on mousedown
-start the rotation on mousedown
-when rotation is startrotation +90degrees -> stop and go back to idle.

so from there i would be able to rotate 90degrees with every mousedown.

pandigital

  • Playmaker Newbie
  • *
  • Posts: 23
Re: noob question: rotating a cube 90degrees
« Reply #2 on: September 15, 2011, 02:59:12 AM »



NGKrush

  • Playmaker Newbie
  • *
  • Posts: 10
Re: noob question: rotating a cube 90degrees
« Reply #3 on: September 15, 2011, 04:15:43 AM »
thanks for your reply pandigital,
with your setup the cube will rotate but not stop.
it needs to recognize being moved at exactly 90degrees and send a message to stop.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: noob question: rotating a cube 90degrees
« Reply #4 on: September 15, 2011, 11:22:03 AM »
There are quite a few ways to do this in Playmaker.

I've attached one way, using Animate Float to animate the yAngle and Set Rotation to rotate the cube.

You could also use Float Interpolate to animate yAngle, or an iTween action to animate the rotation.


NGKrush

  • Playmaker Newbie
  • *
  • Posts: 10
Re: noob question: rotating a cube 90degrees
« Reply #5 on: September 15, 2011, 06:42:59 PM »
thanks alex! this works now.
is there a way for pm to remember the action/new rotation, so i can keep rotating with every mouseclick? right now it resets back to the original state when i click again.
tnx so much!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: noob question: rotating a cube 90degrees
« Reply #6 on: September 15, 2011, 06:56:49 PM »
You can use Get Rotation to get the current rotation of the cube and add 90 to that...

A lot of things are done with Get and Set actions in Playmaker.

If you type Get or Set into the action browser search field you'll get a feel for the different things you can do.

NGKrush

  • Playmaker Newbie
  • *
  • Posts: 10
Re: noob question: rotating a cube 90degrees
« Reply #7 on: September 16, 2011, 06:29:46 AM »
Ok, I understand that now.

I solved it differently by using the V2 version of the Animate Float.
In that Action there is the Calculation dropdown. Setting that to 'AddtoValue'
does the get rotation automatically.

Thanks for all the help guys!

ps. Now I have to setthe curve manually to 90degrees. I can't get it exactly on the 90degrees mark, is there a way to manually input that on the curvescreen?
« Last Edit: September 16, 2011, 06:41:51 AM by NGKrush »