# llUpdateCharacter

*LSL function*

```lsl
void llUpdateCharacter(list options);
```

- `list options`: A list of key-value pairs specifying the character's new configuration options (takes same constants as llCreateCharacter).

- Energy: 10

Updates settings for a pathfinding character using the parameters specified in options.

Updates settings for a character

```lsl title="How to use" frame="terminal"
llUpdateCharacter([]);
```

## Specification

Constant group [CharacterParam](/constants/groups/CharacterParam/):

```lsl
CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES = 14
CHARACTER_AVOIDANCE_MODE = 5
CHARACTER_DESIRED_SPEED = 1
CHARACTER_DESIRED_TURN_SPEED = 12
CHARACTER_LENGTH = 3
CHARACTER_MAX_ACCEL = 8
CHARACTER_MAX_DECEL = 9
CHARACTER_MAX_SPEED = 13
CHARACTER_MAX_TURN_RADIUS = 10
CHARACTER_ORIENTATION = 4
CHARACTER_RADIUS = 2
CHARACTER_STAY_WITHIN_PARCEL = 15
CHARACTER_TYPE = 6
TRAVERSAL_TYPE = 7
```

## Caveats

(subject to change)

- [CHARACTER_DESIRED_SPEED](/constants/CHARACTER_DESIRED_SPEED/) ranges from 0.2 to 40.0.
- [CHARACTER_RADIUS](/constants/CHARACTER_RADIUS/) ranges from 0.1 to 5.0.
- [CHARACTER_LENGTH](/constants/CHARACTER_LENGTH/) ranges from 0.0 to 10.0.
- [TRAVERSAL_TYPE_SLOW](/constants/TRAVERSAL_TYPE_SLOW/) | [TRAVERSAL_TYPE_FAST](/constants/TRAVERSAL_TYPE_FAST/) | [TRAVERSAL_TYPE_NONE](/constants/TRAVERSAL_TYPE_NONE/) - only use one of these parameters or omit. Defaults to [TRAVERSAL_TYPE_NONE](/constants/TRAVERSAL_TYPE_NONE/) to 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](/constants/CHARACTER_TYPE_A/) | [CHARACTER_TYPE_B](/constants/CHARACTER_TYPE_B/) | [CHARACTER_TYPE_C](/constants/CHARACTER_TYPE_C/) | [CHARACTER_TYPE_D](/constants/CHARACTER_TYPE_D/) | [CHARACTER_TYPE_NONE](/constants/CHARACTER_TYPE_NONE/) - only use one of these parameters or omit. Defaults to [CHARACTER_TYPE_NONE](/constants/CHARACTER_TYPE_NONE/) if 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_LENGTH](/constants/CHARACTER_LENGTH/) and [CHARACTER_RADIUS](/constants/CHARACTER_RADIUS/) params 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

<details open>
<summary>Example 1</summary>

```lsl
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]);
    }
}
```

</details>

## History

Date of Release [31/07/2012](https://wiki.secondlife.com/wiki/Release_Notes/Second_Life_Server/12#12-07-31-262785)

## See also

### Functions

- [llCreateCharacter](/functions/llCreateCharacter/)
- [llDeleteCharacter](/functions/llDeleteCharacter/)
- [llEvade](/functions/llEvade/)
- [llExecCharacterCmd](/functions/llExecCharacterCmd/)
- [llGetClosestNavPoint](/functions/llGetClosestNavPoint/)
- [llFleeFrom](/functions/llFleeFrom/)
- [llNavigateTo](/functions/llNavigateTo/)
- [llPatrolPoints](/functions/llPatrolPoints/)
- [llPursue](/functions/llPursue/)
- [llUpdateCharacter](/functions/llUpdateCharacter/)
- [llWanderWithin](/functions/llWanderWithin/)

### Events

- [path_update](/events/path_update/)

---

*Source: [LlUpdateCharacter](https://wiki.secondlife.com/wiki/LlUpdateCharacter) on the Second Life Wiki. Content from the Second Life Wiki articles LlUpdateCharacter (revision 1194330, 2015-01-22) and Template:LSL Constants/llCreateCharacter (revision 1215206, 2023-10-28), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llUpdateCharacter/
