It can let Character automatically follow nearby characters which is controlled by player.
Our follower component can now perform some simple automatic pathfinding and won't get stuck by a simple wall like before. However, to use this feature, the following conditions must be met:
Tips:
When setting up navigation mesh areas, ensure that the generation area covers objects that serve as paths or obstacles.
The navigation mesh needs to be regenerated after each scene update
You can duplicate areas to generate navigation meshes in multiple regions simultaneously. However, for best results, it's recommended to use a single dedicated area
The total number of objects within all generation areas must not exceed 5000. Only use navigation meshes in areas where pathfinding is needed
Try to limit generation areas to only cover necessary regions. For example, if you don't want objects to walk on rooftops, don't include rooftops in the generation area
The current automatic pathfinding feature doesn't support dynamically changing scenes
| Property | Type | Description |
|---|---|---|
| Is Active | Bool | Whether the component is enabled |
| Active When Controlled | Bool | Whether the component takes effect when the character is controlled by the playerThe Is Active attribute is automatically modified only at birth and when controller is switched |
| Target Mode | Enum | The function mode of the Follow component: |
| Event | Description | Parameter |
|---|---|---|
| When following starts | Triggered when starting to follow a target | 1.Object: the target to be followed. It represent the character when chasing a player |
| When reaching target | Triggered when the distance to the target is less than the stopping distance | 1.Object: the target to be followed. It represent the character when chasing a player |
| When target lost | Triggered when target lost |