# AGENT_FLYING

*LSL constant*

```lsl
integer AGENT_FLYING = 0x1;
```

Used with llGetAgentInfo to determine if the queried avatar is flying or hovering.

Constant groups: [AgentInfo](/constants/groups/AgentInfo/)

Used with [llGetAgentInfo](/functions/llGetAgentInfo/) to determine if the queried avatar is flying.

## Examples

<details open>
<summary>Count how many people are currently flying within this parcel</summary>

```lsl collapse={1-10}
// On touch, say how many avatars are currently flying within this parcel
default
{
    touch_start(integer total_number)
    {
        list AgentList = llGetAgentList(AGENT_LIST_PARCEL, [] );
        integer CountAll = (AgentList != [] );
        integer CountFlying;
        key AgentKey;
        while (CountAll)
        {
            AgentKey = llList2Key(AgentList, --CountAll);
            if (llGetAgentInfo(AgentKey) & AGENT_FLYING)       ++CountFlying;
        }
        llSay(0, (string) CountFlying + " avatars are currently flying within this parcel" );
    }
}
```

</details>

## See also

### Constants

| Constant | Val | Returned if agent... |
| --- | --- | --- |
| [4096](/constants/AGENT_ALWAYS_RUN/) | 0x1000 | has running (`"Always Run"`) enabled, or is using tap-tap-hold |
| [2](/constants/AGENT_ATTACHMENTS/) | 0x0002 | has attachments |
| [16384](/constants/AGENT_AUTOMATED/) | 0x4000 | is marked as a scripted agent/bot |
| [8192](/constants/AGENT_AUTOPILOT/) | 0x2000 | is in `"autopilot"` mode |
| [64](/constants/AGENT_AWAY/) | 0x0040 | is in `"away"` mode |
| [2048](/constants/AGENT_BUSY/) | 0x0800 | is in `"busy"` mode |
| [1024](/constants/AGENT_CROUCHING/) | 0x0400 | is crouching |
| [32768](/constants/AGENT_FLOATING_VIA_SCRIPTED_ATTACHMENT/) | 0x8000 | is floating or hovering because of a scripted attachment |
| [1](/constants/AGENT_FLYING/) | 0x0001 | is flying or hovering |
| [256](/constants/AGENT_IN_AIR/) | 0x0100 | is in the air (jumping, flying or falling) |
| [8](/constants/AGENT_MOUSELOOK/) | 0x0008 | is in mouselook |
| [32](/constants/AGENT_ON_OBJECT/) | 0x0020 | is sitting on an object (and linked to it) |
| [4](/constants/AGENT_SCRIPTED/) | 0x0004 | has scripted attachments |
| [16](/constants/AGENT_SITTING/) | 0x0010 | is sitting[^wiki-4c7da7] |
| [512](/constants/AGENT_TYPING/) | 0x0200 | is typing |
| [128](/constants/AGENT_WALKING/) | 0x0080 | is walking, running or crouch walking |

[^wiki-4c7da7]: "Sit down" on the avatar context menu allows ground sits anywhere: atop the terrain, on objects or even in the air, so it is possible to sit "on" an object without linking.

### Functions

- [llGetAgentInfo](/functions/llGetAgentInfo/)

---

*Source: [AGENT FLYING](https://wiki.secondlife.com/wiki/AGENT_FLYING) on the Second Life Wiki. Content from the Second Life Wiki articles AGENT FLYING (revision 1215050, 2023-10-14) and Template:LSL Constants/llGetAgentInfo (revision 1217720, 2024-12-05), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/constants/AGENT_FLYING/
