← Previous | Next →
goToEntity
Description
Makes the NPC move towards a specified entity within a given distance and speed.
| Name | Type | Possibilities |
| goToEntity | behaviour | 2 |
Parameters
| # | Name | Type | Mandatory | Description | Multiple |
| 1 | entity | Entity | Yes | The entity that the NPC will move towards. | No |
| 2 | distance | number | No | The distance at which the NPC will stop moving towards the entity. Defaults to 2.0 if not specified. | No |
| 3 | speed | number | No | The speed at which the NPC should move towards the entity. Defaults to 2.0 if not specified. | No |
Outputs
| # | Description |
| 1 | The NPC is already within the specified distance from the entity. |
| 2 | The NPC is moving towards the entity. |
Example
NPC
name Follower
model s_m_y_cop_01
position -1020.72 4839.78 258.30 0.0
interaction
nothing
behaviour
goToEntity player 5.0 3.0