constrain rotation?

diegocsdiegocs Member Posts: 531
can i constrain actors rotation lets say between 60-150?

Answers

  • master200012master200012 Member Posts: 372
    You'd have to set up an equation of some sort. You can't simply "constrain attribute to anywhere between 60-150." It's restrictive, I know, but there has to be some constraining attribute with properties that prevent it from falling below a certain value (like index attributes) or rising above another.

    Blunty put, not directly.

    Hope this helps! (if anyone can understand it :P)
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    To have the actor point toward the mouse it would look something like:
    Constrain Attribute: self.Rotation To: min(150,max(60,vectorToAngle( game.Mouse.Position.X - self.Position.X , game.Mouse.Position.Y - self.Position.Y )))

    To have the actor rotate to some other calculated angle it would look like:
    Constrain Attribute: self.Rotation To: min(150,max(60,someOtherAngle))
Sign In or Register to comment.