Create Simple Door

Prepare your GameObject

Here is what you should have now:

SmartDoor and its child

Configure your SmartDoor

Once you have both, SmartDoor GameObject and its child, you can start configuring it.

Hinge Positioning

In the process of setting up your door, you may encounter issues with the Hinge position, as illustrated below:

Hinge positioning

To correct the Hinge position, follow these steps:

  1. Click on the "Bottom Right" button in the Hinge section to adjust the Hinge position:

After adjusting, you might find yourself in one of the following situations:

  1. If the Hinge position is perfect, go to "Motion" step.

  2. If the Hinge position is not ideal, follow the next steps.

Fine-Tuning the Hinge Position:

  1. Adjust Hinge Offset:

    • Still in the Hinge Section, modify the "Hinge Offset" until the pivot point aligns perfectly with your door.

    • If your door had a well-positioned Pivot Point, you can restore it by clicking the "GFX Pivot Point" button instead of adjusting the offset.

  2. Recalculate Detection Area:

    • After changing the Hinge position, remember to recalculate the Detection Area for accurate functionality.

By following these steps, you can ensure that the Hinge is correctly positioned, leading to smooth door animations and functionality.

Motion

By default, Door System opens doors with an angle of -90 degrees, which is suitable for Right-Handled doors. However, for Left-Handled doors, an angle of 90 degrees is recommended.

Why Use Negative Values for Left-Handled Doors?

When defining the Open Angle, it's crucial to open the door in the Local Forward direction. This orientation assists Door System in correctly aligning the door based on the player's position. Special considerations may apply based on specific needs.

Open door in forwar direction

To set the appropriate Open Angle:

  1. Adjust the Open Angle to 90 degrees for Left-Handled Doors.

  2. Click on "Use Open Angle as Open" to save your new angle.

Detection Area Configuration

By default, the Detection Area detects all GameObjects that enter. To filter them, utilize the "Layer Mask" or enable "Use Tag Mask."

Follow these steps:

  1. Enable "Use Tag Mask" and select a Tag exclusively assigned to your Player.

  2. Enable "Open On Detect" to allow the door to open upon detecting a GameObject with the specified Tag.

  3. Click on "Calculate Detection Area" to finalize the settings.

Now, enter Play mode and move your character close to the door. You should observe the door magically opening in the Player's forward direction!

Last updated

Was this helpful?