![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
Moves the moving platforms and the entities on it. Each moving platform has its own MovingPlatform script attached.
Documentation updated 12/23/2024
Prevent entities from clipping into walls when being pushed into them.
Prevent colliding moving platforms from sticking together (or just never place them in each other's path).
Public Attributes | |
float | moveSpeed = 2.5f |
The speed at which the platform will move at. | |
float | pauseDuration = 1f |
The amount of time the platform will stop between each point (in seconds). | |
Protected Attributes | |
MovableEntityDetector | entityDetector |
Detects the entities that are standing on the platform (controlled by a different script). | |
Transform | path |
The object with children as the points that the platform will move between. | |
Private Member Functions | |
void | Awake () |
Set reference to the moving platform's rigidbody and initial target point. | |
void | Update () |
Private Attributes | |
Rigidbody2D | rb |
Reference to the platform's rigidbody component. | |
float | pauseCounter = 0f |
Keeps track of how long the platform has been stopped before going to a new point (in seconds). | |
Transform | targetPoint |
The point that the platform should be moving towards. | |
int | targetPointIndex = 0 |
Keeps track of which point the platform should be moving towards. | |
Vector2 | previousPosition |
Needed for calculating how far the platform has moved each frame when updating the position of entities standing atop. | |
|
private |
Set reference to the moving platform's rigidbody and initial target point.
|
private |
|
protected |
Detects the entities that are standing on the platform (controlled by a different script).
float MovingPlatform.moveSpeed = 2.5f |
The speed at which the platform will move at.
|
protected |
The object with children as the points that the platform will move between.
|
private |
Keeps track of how long the platform has been stopped before going to a new point (in seconds).
float MovingPlatform.pauseDuration = 1f |
The amount of time the platform will stop between each point (in seconds).
|
private |
Needed for calculating how far the platform has moved each frame when updating the position of entities standing atop.
|
private |
Reference to the platform's rigidbody component.
|
private |
The point that the platform should be moving towards.
|
private |
Keeps track of which point the platform should be moving towards.