![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
This script is used by trigger zone(s) around some entities' sides that detects when the entity is touching a wall. This is also used by the player! Options:
This detects the layer(s) selected on this script in the inspector, which should usually be set to "Ground" and "Collision" This script can only detect objects that have colliders.
Documentation updated 12/19/2024
Private Member Functions | |
void | Awake () |
void | OnTriggerEnter2D (Collider2D col) |
Runs when an object enters the wall detector zone. Updates WallDetectorInfo. | |
void | OnTriggerStay2D (Collider2D col) |
Runs when an object is inside the wall detector zone. Updates WallDetectorInfo. This part is not necessary for the wall detector to work, but it is kept for redundancy. | |
void | OnTriggerExit2D (Collider2D col) |
Runs when an object exits the wall detector zone. Updates WallDetectorInfo. | |
Private Attributes | |
WallDetectorSide | side = WallDetectorSide.Both |
Tell this script in the inspector which side of the entity this trigger zone is attached to. | |
WallDetectorInfo | wallDetectorInfo |
|
private |
|
private |
Runs when an object enters the wall detector zone. Updates WallDetectorInfo.
col | Represents the object inside the trigger zone. |
|
private |
Runs when an object exits the wall detector zone. Updates WallDetectorInfo.
col | Represents the object inside the trigger zone. |
|
private |
Runs when an object is inside the wall detector zone. Updates WallDetectorInfo. This part is not necessary for the wall detector to work, but it is kept for redundancy.
col | Represents the object inside the trigger zone. |
|
private |
Tell this script in the inspector which side of the entity this trigger zone is attached to.
|
private |
WallDetectorInfo is what keeps track of when the entity is touching a wall and which layers should count as wall. If the wall detector has one trigger zone, WallDetectorInfo will be on this script. If the wall detector has two trigger zones, WallDetectorInfo will be on the parent object of this script.