Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
MovableEntityDetector Class Reference

Detailed Description

Used by a trigger zone on moving platforms and spring tiles to detect movable entities. Objects that have colliders but should not be pushed around, such as tilemaps or GroundDetectors, should not get detected.

Documentation updated 12/25/2024

Author
Alexander Art
Todo
Make sure that nothing that shouldn't be moved can be detected by this script. Currently, this script can detect other moving platforms, which is a problem.

Public Attributes

List< GameObject > entitiesInDetector
 List of all objects standing in the trigger zone. Must have Rigidbody2D's attached and not be a tilemap.
 

Private Member Functions

void OnTriggerEnter2D (Collider2D collision)
 Runs when a collider stands on the object. Adds any valid entities that are touching the trigger zone to the list.

Parameters
collision

 
void OnTriggerExit2D (Collider2D collision)
 Runs when a collider gets off of the object. Removes any objects that are no longer touching the trigger zone from the list.

Parameters
collision

 

Member Function Documentation

◆ OnTriggerEnter2D()

void MovableEntityDetector.OnTriggerEnter2D ( Collider2D collision)
private

Runs when a collider stands on the object. Adds any valid entities that are touching the trigger zone to the list.

Parameters
collision

◆ OnTriggerExit2D()

void MovableEntityDetector.OnTriggerExit2D ( Collider2D collision)
private

Runs when a collider gets off of the object. Removes any objects that are no longer touching the trigger zone from the list.

Parameters
collision

Member Data Documentation

◆ entitiesInDetector

List<GameObject> MovableEntityDetector.entitiesInDetector

List of all objects standing in the trigger zone. Must have Rigidbody2D's attached and not be a tilemap.


The documentation for this class was generated from the following file: