Create Simple Door
Last updated
Was this helpful?
Last updated
Was this helpful?
To use Door System, you just have to add a SmartDoor Component on your GameObject. But you still have to respect the following contraints, required by design:
Create an Empty Object as Parent of your Door
Add SmartDoor component onto the Parent
Parent must have uniform scaling (1,1,1), (2,2,2), (3,3,3), etc...
Here is what you should have now:
Once you have both, SmartDoor GameObject and its child, you can start configuring it.
Important Note: DoorSystem relies on the GameObject's local forward direction to determine right and left.
In the process of setting up your door, you may encounter issues with the Hinge position, as illustrated below:
To correct the Hinge position, follow these steps:
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:
If the Hinge position is perfect, go to "Motion" step.
If the Hinge position is not ideal, follow the next steps.
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.
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.
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.
To set the appropriate Open Angle:
Adjust the Open Angle to 90 degrees for Left-Handled Doors.
Click on "Use Open Angle as Open" to save your new angle.
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:
Enable "Use Tag Mask" and select a Tag exclusively assigned to your Player.
Enable "Open On Detect" to allow the door to open upon detecting a GameObject with the specified Tag.
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!