actor rotate problem

feromanferoman Member, PRO Posts: 130
edited September 2012 in Working with GS (Mac)
An iron bar remains fixed, but shall rotate on same!

from the beginning of the scene, the actor turns 15 ° opposite hand of a clock (for example) and then returns to show direction of 345 ° or 30 °.
code below.
image
Uploaded with ImageShack.us
this works, but only once.
I want this bar is rotated 15 ° and -15 ° continuously.
How? behavior with the "TIMER" does not work as I want.

Help me!

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Try this:

    Change Attribute: self.Motion.Angular Velocity To: 20

    Rule: When (Any)
    --Attribute: Self.Rotation > 15
    --Attribute.Self.Rotation < -15
    ----Change Attribute: self.Motion.Angular Velocity To: -self.Motion.Angular Velocity


    This should get it rocking back and forth between +15 and -15 degrees at a speed of '20'.
  • feromanferoman Member, PRO Posts: 130
    Thanks
  • feromanferoman Member, PRO Posts: 130
    a few problem,
    During a collision with another object, the bar moves strangely, it does not remain on its original position.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Use two constrain behaviors to 'pin' the actor to the x and y position you want:

    Constrain Attribute: self.position.x To: (your x coordinate here)
    Constrain Attribute: self.position.y To: (your y coordinate here)
Sign In or Register to comment.