Orbiting actor won't face direction they are travelling

micksolomicksolo Member Posts: 264
edited July 2012 in Working with GS (Mac)
Hi,

I set up an actor to be "orbiting" using constrain pos x and y to cos and sin functions. It works fine.

Then I added a rule to make the actor face towards the direction it's moving using this rule:

constrains self.rotation to VectorToAngle(self.motion.linear.velocity.x , self.motion.linear.velocity.y)

but this doesn't seem to have any effect, the actor still moves without facing the direction it's moving. any ideas?

Comments

  • ORBZORBZ Member Posts: 1,304
    When you constrain the x and y position the actor has a velocity of 0.

    What you want to do is constrain the actor's rotation to 90 degres away from the center of its orbit axis.
  • micksolomicksolo Member Posts: 264
    thanks, but don't quite understand how to do this?
  • ORBZORBZ Member Posts: 1,304
    vectorToAngle(centerX-actorX, centerY-actorY)+90
Sign In or Register to comment.