Struct FollowerEntityProxy Extends IAstarAI
Proxy for a FollowerEntity using pure ECS components.
This struct behaves almost identically to the FollowerEntity MonoBehaviour component, but it wraps an Entity in a given world instead. It is used primarily when you are using subscenes, and therefore cannot use the FollowerEntity component at runtime.
This struct gives you the same high-level API as the FollowerEntity component, but without the overhead of dealing with GameObjects and MonoBehaviours.
This struct can only be used on the main thread outside of ECS jobs. When accessing ECS components from within jobs, you must use the ECS api directly.
Usage
Create a subscene (see unity entities documentation).
Create an agent GameObject with a FollowerEntity component within that subscene.
At runtime, the GameObject will be automatically converted to an entity.
You can then use the FollowerEntityProxy struct to interact with the entity.
var follower = new FollowerEntityProxy(world, entity);
follower.maxSpeed = 5;
follower.destination = new Vector3(1, 2, 3);
if (follower.currentNode.Tag == 1) {
Debug.Log("The agent is right now traversing nodes with tag 1");
}See
Inner Types
Public Methods
Calculate how the agent will move during this frame.
Set the position in the world that this agent should move to.
Public Static Methods
Public Variables
Policy for when the agent recalculates its path.
Node which the agent is currently traversing.
Enables or disables debug drawing for this agent.
Velocity that this agent wants to move with.
Velocity that this agent wants to move with before taking local avoidance into account.
Position in the world that this agent should move to.
Direction the agent will try to face when it reaches the destination.
Enables or disables gravity.
True if local avoidance is enabled for this agent.
End point of path the agent is currently following.
Determines which layers the agent will stand on.
True if this agent currently has a valid path that it follows.
Height of the agent in world units.
Gets or sets if the agent should stop moving.
True if the agent is currently traversing an off-mesh link.
True if the agent's local avoidance is temporarily disabled, due to traversing an off-mesh link.
Maximum rotation speed in degrees per second.
Max speed in world units per second.
Provides callbacks during various parts of the movement calculations.
The plane the agent is moving in.
How to calculate which direction is "up" for the agent.
Various movement settings.
The off-mesh link that the agent is currently traversing.
Called when the agent recalculates its path.
Callback to be called when an agent starts traversing an off-mesh link.
Determines which direction the agent moves in.
True if a path is currently being calculated.
Pathfinding settings.
Position of the agent.
How much to smooth the visual position of the agent.
Radius of the agent in world units.
Like reachedEndOfPath, but will also return true if the end of the path is crowded, and this agent has stopped because it cannot get closer.
True if the agent has reached the end of the current path.
Approximate remaining distance along the current path to the end of the path.
Rotation of the agent.
How much to smooth the visual rotation of the agent.
Desired rotation speed in degrees per second.
Local avoidance settings.
Enables or disables movement completely.
Point on the path which the agent is currently moving towards.
How far away from the destination should the agent aim to stop, in world units.
Determines if the character's position should be coupled to the Transform's position.
Determines if the character's rotation should be coupled to the Transform's rotation.
Actual velocity that the agent is moving with, including gravity.
Public Static Variables
Private/Protected Members
Enables or disables a component on an entity.
True if the entity seems to have the required components.
Deprecated Members
Enables or disables recalculating the path at regular intervals.