Rotate variable

stanimationstanimation Member Posts: 406
edited November -1 in Working with GS (Mac)
I'm trying to figure out a way to have the rotation of an actor change as the actor is moved left to right. For example, if the actor is on the left side of the screen its rotation would be 10 degrees. As it is moved to the right is would smoothly change to -10 degrees. Something like that. I know is a attribute constrain thing but I can get in figured out. Any help would be appreciated.

Comments

  • Fafnir312Fafnir312 Member Posts: 161
    I think you could be use the magnitude function (how far an object is from 0,0) and use that to determine degree of rotation. I'll play around with it if I have time and see if I can make an example.
  • Fafnir312Fafnir312 Member Posts: 161
    Strange. I can't edit my previous post now. In any case here's an example. I didn't use magnitude since you only need the x position in the scene.
    http://gamesalad.com/game/play/29674
  • stanimationstanimation Member Posts: 406
    Nice. Thanks Fafnir312! I did it a little different. But same concept.

    rule.png
Sign In or Register to comment.