llUpdateCharacter
function
Function syntax
llUpdateCharacter(list options// A list of key-value pairs specifying the character's new configuration options (takes same constants asllCreateCharacter).
);- Energy
- 10
Updates settings for a pathfinding character using the parameters specified in options.
Updates settings for a character
llUpdateCharacter([]);Specification
Section titled “Specification”// 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
Caveats
Section titled “Caveats”(subject to change)
CHARACTER_DESIRED_SPEEDranges from 0.2 to 40.0.CHARACTER_RADIUSranges from 0.1 to 5.0.CHARACTER_LENGTHranges from 0.0 to 10.0.TRAVERSAL_TYPE_SLOW|TRAVERSAL_TYPE_FAST|TRAVERSAL_TYPE_NONE- only use one of these parameters or omit. Defaults toTRAVERSAL_TYPE_NONEto if omitted. This affects whether a character moving on terrain that is less than 100% walkable will move faster (e.g., a cat crossing a street) or slower (e.g., a car driving in a swamp).CHARACTER_TYPE_A|CHARACTER_TYPE_B|CHARACTER_TYPE_C|CHARACTER_TYPE_D|CHARACTER_TYPE_NONE- only use one of these parameters or omit. Defaults toCHARACTER_TYPE_NONEif omitted. This determines which of the 4 walkability coefficients the character pays attention to.- The character’s shape is a capsule (cylinder with spherical ends) with a length (from tip to tip) and a circular cross section of some radius. These two size parameters are what is controlled by the
CHARACTER_LENGTHandCHARACTER_RADIUSparams respectively. - Note that the characters true “length” cannot be smaller than twice the radius however you’re welcome to specify a value lower than that (but more than zero) — the script shouldn’t complain.
- The capsule is usually oriented vertically. It is possible to make the capsule lie horizontal by using an object that is long in its local X-axis, however these characters might not be able to navigate through gaps that cannot fit them lengthwise.
- Use a vertical capsule whenever possible; horizontal capsules may become stuck more easily than vertical capsules.
- Removing the script from a prim will not stop pathing behavior, in the same way that particles and hover text remain. To stop a pathing command use
llExecCharacterCmd(CHARACTER_CMD_STOP, []).
Examples
Section titled “Examples”Example 1
default{ state_entry() { llCreateCharacter([CHARACTER_DESIRED_SPEED, 10.0]);
list points = [llGetPos() + <5,0,0>, llGetPos() - <5,0,0>]; llPatrolPoints(points, []); }
touch_start(integer total_number) { llUpdateCharacter([CHARACTER_DESIRED_SPEED, 50.0]); }}History
Section titled “History”Date of Release 31/07/2012
See also
Section titled “See also”Functions
Section titled “Functions”llCreateCharacterllDeleteCharacterllEvadellExecCharacterCmdllGetClosestNavPointllFleeFromllNavigateTollPatrolPointsllPursuellUpdateCharacterllWanderWithin
Events
Section titled “Events”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.