Rotating Actor towards movement direction

GuardianGuardian Member Posts: 54
edited November -1 in Working with GS (Mac)
Hi guys,

I have an actor that flies through the air using velocity and gravity brings it back down.

What I want to do is rotate the actor so that it faces the direction it is moving in.

Any ideas?

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    You need to do...

    Constrain self.rotation to vectorToAngle(self.Motion.LinearVelocity.X,self.Motion.LinearVelocity.Y)

    Have the image face to the right if its an arrow for eg and you will be fine...see video at approx 2:20



    Darren.

    image
  • GuardianGuardian Member Posts: 54
    Thank you Darren :)
Sign In or Register to comment.