Rotate Constrained Actor

crapscraps Member Posts: 353
edited November -1 in Working with GS (Mac)
I have two actors who are constrained to each other.
Tested constrain by
Touch - interpolate to position X. Both actors move - works fine.

I really want to be able to rotate the actors.
Tried - Touch - rotate, Touch Rotate to Angle, Touch Rotate to Position.

Only the actor with the Rotate behavior rotates NOT the constrained actor.

Ideas appreciated.

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Make a game level attribute called "bossActorsAngle" (real)

    In the "boss" actor have a rule:
    Constrain attribute: otherActorsAngle To: self.Rotation

    In the "constrained" actor have a rule:
    Constrain attribute: self.Rotation To: otherActorsAngle
  • crapscraps Member Posts: 353
    Thanks. But not sure of what you mean by:

    otherActorsAngle

    Is that another real attribute or the BossActorAngle?

    Thanks
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Yes I just meant to make an attribute -- you can call it whatever you want. But it needs to be a global or game level attribute so that the "constrained" actor can find it in the drop down list of attributes.
  • crapscraps Member Posts: 353
    Thanks - sort of got it working.
    This image is the starting point
    http://i56.tinypic.com/w6plxc.png

    And this image is after the rotation. You can see that the actors don't stay relative to their starting position. i need them to keep them as they started but just rotated.

    http://i55.tinypic.com/28u4imc.png
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Its kind of hard to tell which objects you are talking about. I assume its the vertical white box and the horizontal red box? (And not the blue or long white rectangle?)

    Are they oriented the same way? (Both are oriented with rotation at zero (facing right) to start with?)
  • crapscraps Member Posts: 353
    You are correct on all things. The white and red rectangles do rotate to the same angle.
    But if you look at the red box it does NOT stay flush with the white box. It seems to "slide" down.
    Is it rotating around its center axis?

    Is there a way to make them both rotate only around the center axis of the white box?

    Otherwise should I make a one piece actor to rotate?
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Yes -- everything rotates around its own center axis (by default).

    Yes -- if both objects are always going to be welded to each other by using behaviors, then it might be easier to create a "one piece actor" to rotate.
Sign In or Register to comment.