Component Attributes - Onclick Animate RotZ problems

I am trying to do a couple of simple doors that will open when clicked on, I am trying to get 4 doors to open in each of the 4 possible directions on the ‘Z’ plane. Specifically with 4 door like objects lined up along the ‘X’ axis, each door should open in a different direction, e.g.

  1. Door 1: Swing outward with hinge point on left side
  2. Door 2: Swing outward with hinge point on right side
  3. Door 3: Swing inward with hinge point on left side
  4. Door 4: Swing inward with hinge point on right side

I am using the Component Attributes ‘Onclick’ option with the following “Animate(RotZ, 90, 0)” << This works but how do I get the door to rotate in the opposite direction and also from a different hinge point, e.g. “Animate(RotZ, -90, 0)”. This results in the door/object simply rotating once and then no longer responds.

I have tried setting the axis in a different location by making the object into a ‘Component’ but the Attributes do not stay with the newly created component.

Attached is a file with an example of what I am trying to accomplish.

Any help or guidance much appreciated!

Door RotZ problem.skp (158.9 KB)

If you require it , when using direct reference to rotate, use quotation marks for negative values,
The rotation is about the axis, so move to suit
Door RotZ problem.skp (157.1 KB)

To create a flip within a DC use *-1 on a subgroup
to create multiple use copies

1 Like