Trigger Zones
This door system heavily relies on trigger zones to create proper player-door interactions. Trigger zones are drawn as colored volumes (boxes or spheres) in the scene. You can position/rotate/scale them however you want and change their visual appearance.
Every trigger you see, is connected to a rotation block of a door. Looped and swing rotations both have 2 trigger zones. Single rotations have 1 trigger zone. Trigger zones will automatically be added to your scene/hierarchy whenever you create a rotation. You also have the option to add multiple trigger zones that control the same rotation.
Trigger Component
Every trigger zone has a 'Door Trigger' component attached to it. This component allows you to control how the trigger zone behaves. Trigger zones continuously check a certain set of conditions. If all conditions are met, the trigger zone sends a signal to the door, and a rotation will take place.
You can set what the zones look for in order to allow a rotation.
Player Requirements
Requirement | Description | Takes |
---|---|---|
Tag | Does the object that entered the trigger zone have a certain tag? | Tag |
Name | Does the object that entered the trigger zone has a certain name? | String |
Looking At | Is the player looking at a certain object? | GameObject |
Pressed | Has the user pressed a certain key? | KeyCode String |
Script | Does the player have a certain script component? | MonoBehaviour |
Is Object | Is there a certain object in the trigger zone? | GameObject |