CharacterParam
Constants in the CharacterParam enum.
// Speed and turningCHARACTER_DESIRED_SPEED, float speed // m/s, 0.2 to 40.0; default 6CHARACTER_MAX_SPEED, float max_speed // 1 to 40.0; default 20CHARACTER_MAX_ACCEL, float acceleration // 0.5 to 40.0; default 20CHARACTER_MAX_DECEL, float deceleration // 0.5 to 60.0; default 30CHARACTER_DESIRED_TURN_SPEED, float speed // 0.02 to 40.0; default 6; loosely enforcedCHARACTER_MAX_TURN_RADIUS, float radius // 0.1 to 10.0; default 1.25// Size and shapeCHARACTER_RADIUS, float radius // capsule, 0.125 to 5.0CHARACTER_LENGTH, float length // capsule, up to 10.0; at least 2 × radius + 0.1CHARACTER_ORIENTATION, integer // VERTICAL (default) or HORIZONTAL// Terrain and avoidanceCHARACTER_TYPE, integer // CHARACTER_TYPE_*; default _NONETRAVERSAL_TYPE, integer // TRAVERSAL_TYPE_*; default _SLOW; needs CHARACTER_TYPECHARACTER_AVOIDANCE_MODE, integer // AVOID_* flags; default AVOID_CHARACTERS | AVOID_DYNAMIC_OBSTACLESCHARACTER_STAY_WITHIN_PARCEL, integer // boolean; TRUE keeps it on its parcelCHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES, integer // boolean; default TRUE
Constants
Speed and turning
| Constant | Type | Value | Description |
|---|---|---|---|
CHARACTER_DESIRED_SPEED | integer | 1 | Constant used to indicate that the following argument is the desired speed (or speed of pursuit in meters per second) for a pathfinding character. |
CHARACTER_MAX_SPEED | integer | 13 | Specifies the character's maximum speed (must be between 0.2 and 50 meters/second; default is 20 m/s). Affects speed when avoiding dynamic obstacles and when traversing low-walkability objects in TRAVERSAL_TYPE_FAST mode. |
CHARACTER_MAX_ACCEL | integer | 8 | Specifies the character's maximum acceleration rate (default is 20 m/s²). |
CHARACTER_MAX_DECEL | integer | 9 | Specifies the character's maximum deceleration rate (default is 30 m/s²). |
CHARACTER_DESIRED_TURN_SPEED | integer | 12 | Specifies the character's maximum speed while turning about the Z-axis (default is 6 meters/second). Note that this is only loosely enforced, and a character may turn at higher speeds under certain conditions. |
CHARACTER_MAX_TURN_RADIUS | integer | 10 | Specifies the character's turn radius when traveling at CHARACTER_DESIRED_TURN_SPEED (default is 1.25 meters). |
Size and shape
| Constant | Type | Value | Description |
|---|---|---|---|
CHARACTER_RADIUS | integer | 2 | Sets the collision capsule radius used to define the size of a pathfinding character. |
CHARACTER_LENGTH | integer | 3 | Sets the collision capsule length for a pathfinding character. If the value is less than twice the radius plus 0.1m, it automatically adjusts to twice the radius plus 0.1m. |
CHARACTER_ORIENTATION | integer | 4 | Specifies the orientation of the collision capsule for a pathfinding character to denote how to interpret its size. Valid options are VERTICAL and HORIZONTAL. |
Terrain and avoidance
| Constant | Type | Value | Description |
|---|---|---|---|
CHARACTER_TYPE | integer | 6 | Specifies the preferred surface and terrain terrain-type for the character (default is CHARACTER_TYPE_NONE). Used to describe preferred surfaces rather than behavior (e.g., cows prefer type B, sheep herded along a road prefer type C). |
TRAVERSAL_TYPE | integer | 7 | Pathfinding parameter specifying the character's movement traversal type. Expects TRAVERSAL_TYPE_SLOW (default), _FAST, or _NONE. |
CHARACTER_AVOIDANCE_MODE | integer | 5 | Specifies which objects a pathfinding character avoids (other characters, dynamic obstacles like fast-moving objects and avatars, or both). Combined using bit flags; setting to AVOID_NONE disables avoidance for both categories. |
CHARACTER_STAY_WITHIN_PARCEL | integer | 15 | Determines whether a character is restricted to its starting parcel (default is FALSE). If TRUE, parcel boundaries act as one-way obstacles; the character cannot voluntarily leave and pathfinding behaviors (wander, flee, evade, pursue) will only choose goal points within the parcel. If pushed out, it can re-enter but cannot voluntarily leave again. |
CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES | integer | 14 | If set to FALSE, the pathfinding character will not attempt to catch up on lost time when performance is low, potentially providing more reliable (though potentially more stuttery) movement. Default is TRUE. |
Used by
llCreateCharacterfunctionConverts the linkset containing the script into a pathfinding character entity (required to use pathfinding functions) using the specified options.llUpdateCharacterfunctionUpdates settings for a pathfinding character using the parameters specified in options.