# Create Double Doors

### What are Double Doors? <a href="#what-are-double-doors" id="what-are-double-doors"></a>

**Double Doors** are paired doors with synchronized states and animations. They exhibit specific behavior involving:

* Inverted rotation on certain axes
* Inverted Hinge position
* Inverted Translation movement
* Perfect alignment
* Shared Detection Area

### Double Rotating Doors <a href="#double-rotating-doors" id="double-rotating-doors"></a>

#### Create a SmartDoor <a href="#create-a-smartdoor" id="create-a-smartdoor"></a>

Begin by creating a **Smart Door** following the steps outlined in the [Create a Simple Door guide](https://docs.cgpoly.io/door-system-documentation/general/getting-started/create-simple-door).

#### Create a Second SmartDoor <a href="#create-a-second-smartdoor" id="create-a-second-smartdoor"></a>

The easiest method is to duplicate the first door, though you can recreate one from scratch if desired.

If flipping is necessary, select the Child GameObject and rotate it around the Y-axis by 180 degrees. After this, the Hinge will have a misaligned rotation but you'll be able to correct it with the "Hinge Rotation" field (on the master door, after pairing).

#### Pair the Doors <a href="#pair-the-doors" id="pair-the-doors"></a>

1. Select the Right-Handled Door (random selection is fine, but maintain consistency).
2. In the “**Pairing Section**,” drag and drop the other **SmartDoor** into the “Paired Door” field.

By doing this, you pair the second door to the first. Let’s refer to the first as the “**Master Door**” and the second as the “**Paired Door**.” When a door becomes a “**Paired Door**,” its Hinge position automatically changes to match the inverted position of the **Master Door**. Certain sections are disabled since they’re controlled by the **Master Door**, depending on your settings.

Alignment is still needed. With the **Master Door** selected, go to the “**Pairing**” Section and click on one of the alignment buttons.

For the purpose of this guide, align the doors horizontally.

Adjust the opening angle to your needs and validate it by clicking on “Use Open Angle as open”.

Now, if you preview the Close and Open Position, **Master Door** and **Paired Door** should behave as intended.

### Double Sliding Doors <a href="#double-sliding-doors" id="double-sliding-doors"></a>

**Sliding doors** are even easier!

Once you have paired your door, go to the **Motion Section** and select “Move” instead of “Rotation”. By default, the current world position is used as Close Position.

Click on **Invert for Paired Door** to have inverted translation for the Paired Door. Now you can move your **SmartDoor** (the parent, *not the child*) to the desired Open Position. Usually, you want to move it along its Local X-Axis.

Once you’re satisfied with your Open Position, validate it by clicking on “**Use Position as Open**” that should be green.

Now, if you preview the Close and Open Position, **Master Door** and **Paired Door** should behave as intended.
