# Component Attributes - Onclick Animate RotZ problems

**URL:** <https://forums.sketchup.com/t/component-attributes-onclick-animate-rotz-problems/114028>\
**Category:** Dynamic Components\
**Tags:** components\
**Created:** [January 20, 2020, 5:56pm UTC](https://forums.sketchup.com/t/component-attributes-onclick-animate-rotz-problems/114028 "2020-01-20T17:56:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scouterperry01](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@scouterperry01](https://forums.sketchup.com/u/scouterperry01)\
**Post date:** [January 20, 2020, 5:56pm UTC](https://forums.sketchup.com/t/component-attributes-onclick-animate-rotz-problems/114028/1 "2020-01-20T17:56:31Z")

</div>

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!

Perry  
[Door RotZ problem.skp](https://forums.sketchup.com/uploads/short-url/6aG0w59dLaJKgZQo04jAW8yG1ch.skp) (158.9 KB)

---

<div class="post-metadata">

**Author:** ![pcmoor](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/pcmoor/32/3427_2.png) [@pcmoor](https://forums.sketchup.com/u/pcmoor)\
**Post date:** [January 20, 2020, 9:07pm UTC](https://forums.sketchup.com/t/component-attributes-onclick-animate-rotz-problems/114028/2 "2020-01-20T21:07:32Z")

</div>

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](https://forums.sketchup.com/uploads/short-url/dRPpgMtDuK8ViiAsXphtkUnQsd8.skp) (157.1 KB)

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

https://3dwarehouse.sketchup.com/embed.html?mid=855e54ba-f8ce-4d7a-a2b0-72a30f548a99&width=580&height=326
