Actor to face touch?

aeroblaster4aeroblaster4 Member Posts: 7
edited November -1 in Working with GS (Mac)
I have been trying to get an actor to rotate towards a point touched on a screen, but i cannot get it to rotate more than 180ish degrees. I am using vector to angle in a rotate to angle if touches >= 1. Any help/suggestions/other ways to do it?

Comments

  • AquariusAquarius Member Posts: 282
    Create two attributes. Touchx and touchy

    Constrain or change those to attributes to ur touch.

    Then on the actor u wanna rotate just insert "rotate to position" behavior and in the x and y fields put in touchx and touchy respectively.

    Ooo tochy touchy!

    That should work :)
  • cwbh10cwbh10 Member Posts: 52
    Simple :p...

    (Optional. Rule: if touch is outside) Constrain attribute (self.rotation) to VectortoAngle((game.touches.touch1x-self.positionx),(game.touches.touch1y-self.positiony))

    Vector to angle = target x(-offset x), target y(-offset y)

    "(offset)" optional.
Sign In or Register to comment.