# llForceMouselook

*LSL function*

```lsl
void llForceMouselook(integer mouselook);
```

- `integer mouselook`: Boolean. If TRUE, forces a sitting avatar into mouselook; if FALSE, allows them to keep their current camera mode.

- Energy: 10

Sets whether any avatar sitting on this prim is forced into mouselook mode. Setting mouselook to TRUE forces the mode; FALSE (default) allows the avatar to keep their current camera mode.

Sets if a sitting avatar should be forced into [mouselook](https://wiki.secondlife.com/wiki/mouselook) when they sit on this prim.

A [sit target](/functions/llSitTarget/) is not necessary for this function to work.

```lsl title="How to use" frame="terminal"
llForceMouselook(0);
```

## Caveats

- This function has no effect on avatars already seated.
- The user may exit mouselook mode at any time.
- This can be detected by polling [llGetAgentInfo](/functions/llGetAgentInfo/).
- There is nothing stopping someone from modifying or making a client that ignores this.

## Examples

<details open>
<summary>**Force Mouselook on Sit**</summary>

```lsl
default
{
    state_entry()
    {
        llForceMouselook(TRUE); // Forces sitting avatars into mouselook.

        llForceMouselook(FALSE); // Reverts the setting to the default...
                                 // ...as with a newly created prim.
    }
}
```

</details>

## Tests

- [llForceMouseLook Test](https://wiki.secondlife.com/wiki/llForceMouseLook_Test)

## See also

### Functions

- [llAvatarOnSitTarget](/functions/llAvatarOnSitTarget/)
- [llGetAgentInfo](/functions/llGetAgentInfo/)
- [llGetCameraRot](/functions/llGetCameraRot/)
- [llSetCameraAtOffset](/functions/llSetCameraAtOffset/)
- [llSetCameraEyeOffset](/functions/llSetCameraEyeOffset/)

---

*Source: [LlForceMouselook](https://wiki.secondlife.com/wiki/LlForceMouselook) on the Second Life Wiki. Content from the Second Life Wiki articles LlForceMouselook (revision 1194134, 2015-01-22) and Template:LSL Function/boolean (revision 1185613, 2013-12-24), CC BY-SA 3.0.*

---

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