# at_rot_target

*LSL event*

```lsl
at_rot_target(integer handle, rotation targetrot, rotation ourrot)
```

- `integer handle`: Integer handle returned by the llRotTarget call.
- `rotation targetrot`: Target rotation specified in the llRotTarget call.
- `rotation ourrot`: Current rotation of the object (similar to llGetRot).

Triggered when the script's rotation (ourrot) comes within a defined angle (error) of the target rotation (targetrot) set by a call to llRotTarget (which returns the associated handle).

Result of [llRotTarget](/functions/llRotTarget/) library function call

```lsl title="How to use" frame="terminal"
at_rot_target(integer handle, rotation targetrot, rotation ourrot)
{

}
```

## Examples

For an example, see [llRotTarget](/functions/llRotTarget/)

## See also

### Functions

- [llTarget](/functions/llTarget/) — Setup a target position
- [llTargetRemove](/functions/llTargetRemove/) — Stop a target position
- [llRotTarget](/functions/llRotTarget/) — Setup a target rotation
- [llRotTargetRemove](/functions/llRotTargetRemove/) — Stop a target rotation

### Events

- [not_at_rot_target](/events/not_at_rot_target/)
- [at_target](/events/at_target/)
- [not_at_target](/events/not_at_target/)

---

*Source: [At rot target](https://wiki.secondlife.com/wiki/At_rot_target) on the Second Life Wiki. Content from the Second Life Wiki article At rot target (revision 1186040, 2013-12-31), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/events/at_rot_target/
