GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Rotate with a button

cartercarter Posts: 133Member
edited November -1 in Working with GS (Mac)
i have a game going where I need to rotate an actor with a button. You press the button for right and it goes from straight (horizontal) to 45 degree angle right. The same goes for left. How would I go about this

Comments

  • POLYGAMePOLYGAMe Posts: 3,470Member
    Use the "rotate to" behaviour. So your actor buttons would have something like this: "when touch is pressed, rotate to (whatever angle you want)"

    OR you could interpolate the rotation.
  • cartercarter Posts: 133Member
    OK when I do this it rotates one way but not the other
    any solutions?
    Thanks
  • POLYGAMePOLYGAMe Posts: 3,470Member
    If you want it to rotate left, use negative numbers: rotate e.g. "-45.0". I'm not in front of GS right now but I'm pretty sure that's how it works ;-)
  • JohnPapiomitisJohnPapiomitis Posts: 6,256Member
    POLYGAMe said:
    If you want it to rotate left, use negative numbers: rotate e.g. "-45.0". I'm not in front of GS right now but I'm pretty sure that's how it works ;-)

    im not on my mac either but im like 99% sure your right. I think the center is zero so right would be positive and left negative numbers. Also on the regular rotate behavior there clockwise and couter clockwise but cant remember if its the same for rotate too lol
  • gyroscopegyroscope I am here.Posts: 6,577Member, Sous Chef, PRO
    Tis right; I've just done a little test to remind myself that it works! :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • POLYGAMePOLYGAMe Posts: 3,470Member
    I knew I was right. I'm amazing ;-)
  • JohnPapiomitisJohnPapiomitis Posts: 6,256Member
    POLYGAMe said:
    I knew I was right. I'm amazing ;-)

    cyber pat on the back! haha
This discussion has been closed.