# AgentPrivate

Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0

<div class="api-meta">
<span class="api-kind api-kind-class" data-pagefind-filter="kind:Class">Class</span>
<span data-pagefind-filter="namespace:Sansar.Simulation">Namespace <a href="/scripting/api/sansar.simulation"><code>Sansar.Simulation</code></a></span>
<span>Inherits <a href="/scripting/api/sansar.script/instanceinterface">Sansar.Script.InstanceInterface</a></span>
</div>

<span id="T:Sansar.Simulation.AgentPrivate"></span>

The AgentPrivate class is the full interface for interactions with avatars.

```csharp
public class AgentPrivate : Sansar.Script.InstanceInterface
```

## Remarks

Use via [`AgentScript.AgentPrivate`](/scripting/api/sansar.simulation/agentscript#agentprivate)  to access APIs for the agent the script is on.

## Members at a glance

| Kind | Members |
|---|---|
| **Properties** | [AgentInfo](#agentinfo) · [Client](#client) |
| **Methods** | [AddReaction](#addreaction) · [ApplyRagdollImpulse](#applyragdollimpulse) · [ApplyRagdollImpulseToRegions](#applyragdollimpulsetoregions) · [ClearAllowFlightOverride](#clearallowflightoverride)&#160;<span class="api-dot" title="New in 47.10.0"><span class="api-sr">New in 47.10.0</span></span> · [ClearColorLutOverride](#clearcolorlutoverride)&#160;<span class="api-dot" title="New in 47.10.0"><span class="api-sr">New in 47.10.0</span></span> · [GetAllowFlight](#getallowflight)&#160;<span class="api-dot" title="New in 47.10.0"><span class="api-sr">New in 47.10.0</span></span> · [GetControlPointEnabled](#getcontrolpointenabled) · [GetControlPointOrientation](#getcontrolpointorientation) · [GetControlPointPosition](#getcontrolpointposition) · [GetGravityFactor](#getgravityfactor) · [GetHeldRigidBodies](#getheldrigidbodies) · [GetRagdollBounce](#getragdollbounce) · [GetRagdollEnabled](#getragdollenabled) · [GetScaleFactor](#getscalefactor) · [GetSpeedFactor](#getspeedfactor) · [IgnoreCollisionWith](#ignorecollisionwith) · [IsCollisionIgnoredWith](#iscollisionignoredwith) · [OverrideAudioStream](#overrideaudiostream) · [OverrideIndexedMediaSource](#overrideindexedmediasource) · [OverrideMediaSource](#overridemediasource) · [PerformIndexedMediaAction](#performindexedmediaaction) · [PerformMediaAction](#performmediaaction) · [PlaySound](#playsound) · [PlaySoundAtPosition](#playsoundatposition) · [PlaySoundOnComponent](#playsoundoncomponent) · [PlayStream](#playstream) · [PlayStreamAtPosition](#playstreamatposition) · [PlayStreamOnComponent](#playstreamoncomponent) · [RemoveReaction](#removereaction) · [SendChat](#sendchat) · [SetAllowFlight](#setallowflight)&#160;<span class="api-dot" title="New in 47.10.0"><span class="api-sr">New in 47.10.0</span></span> · [SetColorLut](#setcolorlut)&#160;<span class="api-dot" title="New in 47.10.0"><span class="api-sr">New in 47.10.0</span></span> · [SetGravityFactor](#setgravityfactor) · [SetRagdollBounce](#setragdollbounce) · [SetRagdollEnabled](#setragdollenabled) · [SetScaleFactor](#setscalefactor) · [SetScaleFactorAnimated](#setscalefactoranimated) · [SetSpeedFactor](#setspeedfactor) · [ToString](#tostring) |

## Properties

### AgentInfo

<div class="api-card">
<span id="P:Sansar.Simulation.AgentPrivate.AgentInfo"></span>

```csharp signature
public AgentInfo AgentInfo { get; }
```

Returns the [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) for this instance.

**Value:** [AgentInfo](/scripting/api/sansar.simulation/agentinfo) — The [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) for this instance

<details class="api-remarks"><summary>Remarks</summary>

The [`AgentInfo`](/scripting/api/sansar.simulation/agentinfo) holds information about an agent.

</details>

</div>

### Client

<div class="api-card">
<span id="P:Sansar.Simulation.AgentPrivate.Client"></span>

```csharp signature
public Client Client { get; }
```

Returns the [`Client`](/scripting/api/sansar.simulation/client) for this instance.

**Value:** [Client](/scripting/api/sansar.simulation/client) — The [`Client`](/scripting/api/sansar.simulation/client) for this instance

<details class="api-remarks"><summary>Remarks</summary>

The [`Client`](/scripting/api/sansar.simulation/client) manages interactions with a client.

</details>

</div>


## Methods

### AddReaction

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.AddReaction(System.String,System.String,Sansar.Simulation.ThumbnailedClusterResource)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 43.2.1</span></div>

```csharp signature
public void AddReaction(
    string reactionType,
    string displayText,
    ThumbnailedClusterResource resource
)
```

Add a new reaction type to this agent only

| Parameter | Type | Description |
|---|---|---|
| `reactionType` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string that gets passed to the callback.  Should be of a form like &#39;Developer.Type&#39; to match the default, e.g. &#39;Sansar.Fire&#39; |
| `displayText` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A short string that appears on the emotes panel |
| `resource` | [ThumbnailedClusterResource](/scripting/api/sansar.simulation/thumbnailedclusterresource) | A cluster source which has a thumbnail defined in inventory. |

</div>

### ApplyRagdollImpulse

<div class="api-card" id="applyragdollimpulse-vector">
<span id="M:Sansar.Simulation.AgentPrivate.ApplyRagdollImpulse(Sansar.Vector)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void ApplyRagdollImpulse(Sansar.Vector impulse)
```

Applies a linear impulse to the entire ragdoll.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. |

<details class="api-remarks"><summary>Remarks</summary>

This automatically enables ragdoll if needed and uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="applyragdollimpulse-vector-action">
<span id="M:Sansar.Simulation.AgentPrivate.ApplyRagdollImpulse(Sansar.Vector,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void ApplyRagdollImpulse(
    Sansar.Vector impulse,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Applies a linear impulse to the entire ragdoll.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

This automatically enables ragdoll if needed and uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="applyragdollimpulse-vector-single">
<span id="M:Sansar.Simulation.AgentPrivate.ApplyRagdollImpulse(Sansar.Vector,System.Single)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void ApplyRagdollImpulse(
    Sansar.Vector impulse,
    float autoRecoverDelaySeconds
)
```

Applies a linear impulse to the entire ragdoll and sets the auto-recovery delay.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. |
| `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. |

<details class="api-remarks"><summary>Remarks</summary>

This automatically enables ragdoll if needed. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="applyragdollimpulse-vector-single-action">
<span id="M:Sansar.Simulation.AgentPrivate.ApplyRagdollImpulse(Sansar.Vector,System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void ApplyRagdollImpulse(
    Sansar.Vector impulse,
    float autoRecoverDelaySeconds,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Applies a linear impulse to the entire ragdoll and sets the auto-recovery delay.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. |
| `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

This automatically enables ragdoll if needed. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

### ApplyRagdollImpulseToRegions

<div class="api-card" id="applyragdollimpulsetoregions-vector-ragdollregion">
<span id="M:Sansar.Simulation.AgentPrivate.ApplyRagdollImpulseToRegions(Sansar.Vector,Sansar.Simulation.RagdollRegion)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void ApplyRagdollImpulseToRegions(
    Sansar.Vector impulse,
    RagdollRegion regions
)
```

Applies a linear impulse to specific ragdoll body regions.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. |
| `regions` | [RagdollRegion](/scripting/api/sansar.simulation/ragdollregion) | One or more RagdollRegion flags combined with bitwise OR (e.g. RagdollRegion.LeftArm \| RagdollRegion.LeftLeg). |

<details class="api-remarks"><summary>Remarks</summary>

Applying impulse to one side (e.g. LeftArm \| LeftLeg) creates a spinning fall effect. This automatically enables ragdoll if needed and uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="applyragdollimpulsetoregions-vector-ragdollregion-action">
<span id="M:Sansar.Simulation.AgentPrivate.ApplyRagdollImpulseToRegions(Sansar.Vector,Sansar.Simulation.RagdollRegion,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void ApplyRagdollImpulseToRegions(
    Sansar.Vector impulse,
    RagdollRegion regions,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Applies a linear impulse to specific ragdoll body regions.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. |
| `regions` | [RagdollRegion](/scripting/api/sansar.simulation/ragdollregion) | One or more RagdollRegion flags combined with bitwise OR (e.g. RagdollRegion.LeftArm \| RagdollRegion.LeftLeg). |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

Applying impulse to one side (e.g. LeftArm \| LeftLeg) creates a spinning fall effect. This automatically enables ragdoll if needed and uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="applyragdollimpulsetoregions-vector-ragdollregion-single">
<span id="M:Sansar.Simulation.AgentPrivate.ApplyRagdollImpulseToRegions(Sansar.Vector,Sansar.Simulation.RagdollRegion,System.Single)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void ApplyRagdollImpulseToRegions(
    Sansar.Vector impulse,
    RagdollRegion regions,
    float autoRecoverDelaySeconds
)
```

Applies a linear impulse to specific ragdoll body regions and sets the auto-recovery delay.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. |
| `regions` | [RagdollRegion](/scripting/api/sansar.simulation/ragdollregion) | One or more RagdollRegion flags combined with bitwise OR (e.g. RagdollRegion.LeftArm \| RagdollRegion.LeftLeg). |
| `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. |

<details class="api-remarks"><summary>Remarks</summary>

Applying impulse to one side (e.g. LeftArm \| LeftLeg) creates a spinning fall effect. This automatically enables ragdoll if needed. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="applyragdollimpulsetoregions-vector-ragdollregion-single-action">
<span id="M:Sansar.Simulation.AgentPrivate.ApplyRagdollImpulseToRegions(Sansar.Vector,Sansar.Simulation.RagdollRegion,System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void ApplyRagdollImpulseToRegions(
    Sansar.Vector impulse,
    RagdollRegion regions,
    float autoRecoverDelaySeconds,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Applies a linear impulse to specific ragdoll body regions and sets the auto-recovery delay.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse vector in world space. |
| `regions` | [RagdollRegion](/scripting/api/sansar.simulation/ragdollregion) | One or more RagdollRegion flags combined with bitwise OR (e.g. RagdollRegion.LeftArm \| RagdollRegion.LeftLeg). |
| `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

Applying impulse to one side (e.g. LeftArm \| LeftLeg) creates a spinning fall effect. This automatically enables ragdoll if needed. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

### ClearAllowFlightOverride

<div class="api-card" id="clearallowflightoverride-noargs">
<span id="M:Sansar.Simulation.AgentPrivate.ClearAllowFlightOverride"></span>
<span id="M:Sansar.Simulation.AgentPrivate.ClearAllowFlightOverride()"></span>
<div class="api-badges"><span class="api-badge api-new">New in 47.10.0</span></div>

```csharp signature
public void ClearAllowFlightOverride()
```

Clears this agent&#39;s per-agent flight override.

<details class="api-remarks"><summary>Remarks</summary>

The agent will inherit this instance&#39;s default. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.

</details>

</div>

<div class="api-card" id="clearallowflightoverride-action">
<span id="M:Sansar.Simulation.AgentPrivate.ClearAllowFlightOverride(System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-new">New in 47.10.0</span></div>

```csharp signature
public void ClearAllowFlightOverride(
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Clears this agent&#39;s per-agent flight override.

| Parameter | Type | Description |
|---|---|---|
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

The agent will inherit this instance&#39;s default. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.

</details>

</div>

### ClearColorLutOverride

<div class="api-card" id="clearcolorlutoverride-noargs">
<span id="M:Sansar.Simulation.AgentPrivate.ClearColorLutOverride"></span>
<span id="M:Sansar.Simulation.AgentPrivate.ClearColorLutOverride()"></span>
<div class="api-badges"><span class="api-badge api-new">New in 47.10.0</span></div>

```csharp signature
public void ClearColorLutOverride()
```

Clears this agent&#39;s color LUT override.

<details class="api-remarks"><summary>Remarks</summary>

The agent goes back to the scene-wide LUT, see [`ScenePrivate.SetColorLut`](/scripting/api/sansar.simulation/sceneprivate#setcolorlut-textureresource). The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.

</details>

</div>

<div class="api-card" id="clearcolorlutoverride-action">
<span id="M:Sansar.Simulation.AgentPrivate.ClearColorLutOverride(System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-new">New in 47.10.0</span></div>

```csharp signature
public void ClearColorLutOverride(
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Clears this agent&#39;s color LUT override.

| Parameter | Type | Description |
|---|---|---|
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

The agent goes back to the scene-wide LUT, see [`ScenePrivate.SetColorLut`](/scripting/api/sansar.simulation/sceneprivate#setcolorlut-textureresource). The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.

</details>

</div>

### GetAllowFlight

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.GetAllowFlight"></span>
<span id="M:Sansar.Simulation.AgentPrivate.GetAllowFlight()"></span>
<div class="api-badges"><span class="api-badge api-new">New in 47.10.0</span></div>

```csharp signature
public bool GetAllowFlight()
```

Gets whether flying is available for this agent.

**Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — The agent&#39;s override, or the instance default if no override is set.

<details class="api-remarks"><summary>Remarks</summary>

This is the committed effective permission; control mode and interaction rules still apply.

</details>

</div>

### GetControlPointEnabled

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.GetControlPointEnabled(Sansar.Simulation.ControlPointType)"></span>

```csharp signature
public bool GetControlPointEnabled(ControlPointType type)
```

Retrieves whether the control point is enabled.

| Parameter | Type | Description |
|---|---|---|
| `type` | [ControlPointType](/scripting/api/sansar.simulation/controlpointtype) | See [`ControlPointType`](/scripting/api/sansar.simulation/controlpointtype). |

**Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if the control point is enabled. Control points are enabled when used.

<details class="api-remarks"><summary>Remarks</summary>

Control points are a representation of some spatial inputs, primarily VR controllers.

</details>

</div>

### GetControlPointOrientation

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.GetControlPointOrientation(Sansar.Simulation.ControlPointType)"></span>

```csharp signature
public Sansar.Quaternion GetControlPointOrientation(
    ControlPointType type
)
```

Retrieves the orientation in character relative space of the specified control point.

| Parameter | Type | Description |
|---|---|---|
| `type` | [ControlPointType](/scripting/api/sansar.simulation/controlpointtype) | See [`ControlPointType`](/scripting/api/sansar.simulation/controlpointtype). |

**Returns:** [Sansar.Quaternion](/scripting/api/sansar/quaternion) — The orientation of the control point.

<details class="api-remarks"><summary>Remarks</summary>

Control points are a representation of some spatial inputs, primarily VR controllers.

</details>

</div>

### GetControlPointPosition

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.GetControlPointPosition(Sansar.Simulation.ControlPointType)"></span>

```csharp signature
public Sansar.Vector GetControlPointPosition(ControlPointType type)
```

Retrieves the position in character relative space of the specified control point.

| Parameter | Type | Description |
|---|---|---|
| `type` | [ControlPointType](/scripting/api/sansar.simulation/controlpointtype) | The control point to get the position of. See [`ControlPointType`](/scripting/api/sansar.simulation/controlpointtype). |

**Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — The position of the control point.

<details class="api-remarks"><summary>Remarks</summary>

Control points are a representation of some spatial inputs, primarily VR controllers.

</details>

</div>

### GetGravityFactor

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.GetGravityFactor"></span>
<span id="M:Sansar.Simulation.AgentPrivate.GetGravityFactor()"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 34.2.0</span></div>

```csharp signature
public float GetGravityFactor()
```

Retrieves what factor of the world&#39;s gravity is applied to this agent.

**Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The gravity factor.

</div>

### GetHeldRigidBodies

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.GetHeldRigidBodies"></span>
<span id="M:Sansar.Simulation.AgentPrivate.GetHeldRigidBodies()"></span>

```csharp signature
public IEnumerable<RigidBodyComponent> GetHeldRigidBodies()
```

Retrieves a list of [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent) that this agent is currently holding.

**Returns:** [IEnumerable&lt;RigidBodyComponent&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — a list of [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent)

</div>

### GetRagdollBounce

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.GetRagdollBounce"></span>
<span id="M:Sansar.Simulation.AgentPrivate.GetRagdollBounce()"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public float GetRagdollBounce()
```

Gets the current ragdoll bounce factor.

**Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The bounce factor (0-1).

</div>

### GetRagdollEnabled

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.GetRagdollEnabled"></span>
<span id="M:Sansar.Simulation.AgentPrivate.GetRagdollEnabled()"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public bool GetRagdollEnabled()
```

Returns whether ragdoll physics is currently active for this agent.

**Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if ragdoll is active.

</div>

### GetScaleFactor

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.GetScaleFactor"></span>
<span id="M:Sansar.Simulation.AgentPrivate.GetScaleFactor()"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public float GetScaleFactor()
```

Retrieves the runtime scale factor applied to this agent.

**Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The scale factor.

</div>

### GetSpeedFactor

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.GetSpeedFactor"></span>
<span id="M:Sansar.Simulation.AgentPrivate.GetSpeedFactor()"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 36.8.0</span></div>

```csharp signature
public float GetSpeedFactor()
```

Retrieves what factor of the base speed to apply to this agent.

**Returns:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The speed factor.

</div>

### IgnoreCollisionWith

<div class="api-card" id="ignorecollisionwith-rigidbodycomponent-boolean">
<span id="M:Sansar.Simulation.AgentPrivate.IgnoreCollisionWith(Sansar.Simulation.RigidBodyComponent,System.Boolean)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 36.8.0</span></div>

```csharp signature
public void IgnoreCollisionWith(
    RigidBodyComponent rigidBodyComponent,
    bool ignoreBody
)
```

Sets whether this agent will ignore collisions with a specific [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent)

| Parameter | Type | Description |
|---|---|---|
| `rigidBodyComponent` | [RigidBodyComponent](/scripting/api/sansar.simulation/rigidbodycomponent) | The RigidBodyComponent with which to change collision behavior. |
| `ignoreBody` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | When true, collision will be added to the ignore list. When false, collision will removed from the ignore list. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="ignorecollisionwith-rigidbodycomponent-boolean-action">
<span id="M:Sansar.Simulation.AgentPrivate.IgnoreCollisionWith(Sansar.Simulation.RigidBodyComponent,System.Boolean,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 36.8.0</span></div>

```csharp signature
public void IgnoreCollisionWith(
    RigidBodyComponent rigidBodyComponent,
    bool ignoreBody,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sets whether this agent will ignore collisions with a specific [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent)

| Parameter | Type | Description |
|---|---|---|
| `rigidBodyComponent` | [RigidBodyComponent](/scripting/api/sansar.simulation/rigidbodycomponent) | The RigidBodyComponent with which to change collision behavior. |
| `ignoreBody` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | When true, collision will be added to the ignore list. When false, collision will removed from the ignore list. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

### IsCollisionIgnoredWith

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.IsCollisionIgnoredWith(Sansar.Simulation.RigidBodyComponent)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 36.8.0</span></div>

```csharp signature
public bool IsCollisionIgnoredWith(
    RigidBodyComponent rigidBodyComponent
)
```

Checks whether an agent is ignoring collisions with a specific [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent).

| Parameter | Type | Description |
|---|---|---|
| `rigidBodyComponent` | [RigidBodyComponent](/scripting/api/sansar.simulation/rigidbodycomponent) | The RigidBodyComponent that could possibly be ignored. |

**Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

</div>

### OverrideAudioStream

<div class="api-card" id="overrideaudiostream-string">
<span id="M:Sansar.Simulation.AgentPrivate.OverrideAudioStream(System.String)"></span>

```csharp signature
public void OverrideAudioStream(string url)
```

Overrides source of web audio streams.

| Parameter | Type | Description |
|---|---|---|
| `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. |

<details class="api-remarks"><summary>Remarks</summary>

Applies to this agent only.  NOTE: this may cause a few seconds of silence while restarting the stream.  To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.

</details>

</div>

<div class="api-card" id="overrideaudiostream-string-action">
<span id="M:Sansar.Simulation.AgentPrivate.OverrideAudioStream(System.String,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

```csharp signature
public void OverrideAudioStream(
    string url,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Overrides source of web audio streams.

| Parameter | Type | Description |
|---|---|---|
| `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

Applies to this agent only.  NOTE: this may cause a few seconds of silence while restarting the stream.  To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.

</details>

</div>

### OverrideIndexedMediaSource

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.OverrideIndexedMediaSource(System.String,System.Int32,System.Int32,System.Int32,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 46.5.0</span></div>

```csharp signature
public void OverrideIndexedMediaSource(
    string url,
    int mediaIndex,
    int mediaWidth,
    int mediaHeight,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Overrides source of indexed media surfaces.

| Parameter | Type | Description |
|---|---|---|
| `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. |
| `mediaIndex` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source index. |
| `mediaWidth` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source width. |
| `mediaHeight` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source height. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

Applies to this agent only.  NOTE: this will cause a few seconds of silence while restarting the stream.  To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.

</details>

</div>

### OverrideMediaSource

<div class="api-card" id="overridemediasource-string">
<span id="M:Sansar.Simulation.AgentPrivate.OverrideMediaSource(System.String)"></span>

```csharp signature
public void OverrideMediaSource(string url)
```

Sets stream channel source.

| Parameter | Type | Description |
|---|---|---|
| `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. |

</div>

<div class="api-card" id="overridemediasource-string-int32-int32">
<span id="M:Sansar.Simulation.AgentPrivate.OverrideMediaSource(System.String,System.Int32,System.Int32)"></span>

```csharp signature
public void OverrideMediaSource(
    string url,
    int mediaWidth,
    int mediaHeight
)
```

Overrides source of media surfaces.

| Parameter | Type | Description |
|---|---|---|
| `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. |
| `mediaWidth` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source width. |
| `mediaHeight` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source height. |

<details class="api-remarks"><summary>Remarks</summary>

Applies to this agent only.  NOTE: this will cause a few seconds of silence while restarting starting the stream.  To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.

</details>

</div>

<div class="api-card" id="overridemediasource-string-int32-int32-action">
<span id="M:Sansar.Simulation.AgentPrivate.OverrideMediaSource(System.String,System.Int32,System.Int32,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

```csharp signature
public void OverrideMediaSource(
    string url,
    int mediaWidth,
    int mediaHeight,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Overrides source of media surfaces.

| Parameter | Type | Description |
|---|---|---|
| `url` | [string](https://learn.microsoft.com/dotnet/api/system.string) | URL to use. |
| `mediaWidth` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source width. |
| `mediaHeight` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source height. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

Applies to this agent only.  NOTE: this will cause a few seconds of silence while restarting the stream.  To avoid silence, assign URLs in your SceneSettings instead, which will pre-load them.

</details>

</div>

### PerformIndexedMediaAction

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.PerformIndexedMediaAction(Sansar.Simulation.MediaAction,System.Int32,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 46.5.0</span></div>

```csharp signature
public void PerformIndexedMediaAction(
    MediaAction action,
    int mediaIndex,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Performs a specific action on the current media surface.

| Parameter | Type | Description |
|---|---|---|
| `action` | [MediaAction](/scripting/api/sansar.simulation/mediaaction) | The action to perform. |
| `mediaIndex` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | (cMediaChannel only) source index. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

Applies to this agent only.

</details>

</div>

### PerformMediaAction

<div class="api-card" id="performmediaaction-mediaaction">
<span id="M:Sansar.Simulation.AgentPrivate.PerformMediaAction(Sansar.Simulation.MediaAction)"></span>

```csharp signature
public void PerformMediaAction(MediaAction action)
```

Performs a specific action on the current media surface.

| Parameter | Type | Description |
|---|---|---|
| `action` | [MediaAction](/scripting/api/sansar.simulation/mediaaction) | The action to perform. |

<details class="api-remarks"><summary>Remarks</summary>

Applies to this agent only.

</details>

</div>

<div class="api-card" id="performmediaaction-mediaaction-action">
<span id="M:Sansar.Simulation.AgentPrivate.PerformMediaAction(Sansar.Simulation.MediaAction,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

```csharp signature
public void PerformMediaAction(
    MediaAction action,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Performs a specific action on the current media surface index.

| Parameter | Type | Description |
|---|---|---|
| `action` | [MediaAction](/scripting/api/sansar.simulation/mediaaction) | The action to perform. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

Applies to this agent only.

</details>

</div>

### PlaySound

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.PlaySound(Sansar.Simulation.SoundResource,Sansar.Simulation.PlaySettings)"></span>

```csharp signature
public PlayHandle PlaySound(
    SoundResource soundResource,
    PlaySettings playSettings
)
```

Play sound to direct output.

| Parameter | Type | Description |
|---|---|---|
| `soundResource` | [SoundResource](/scripting/api/sansar.simulation/soundresource) | The sound resource to play. |
| `playSettings` | [PlaySettings](/scripting/api/sansar.simulation/playsettings) | The play parameters. |

**Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.

<details class="api-remarks"><summary>Remarks</summary>

Plays for this agent only.

</details>

</div>

### PlaySoundAtPosition

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.PlaySoundAtPosition(Sansar.Simulation.SoundResource,Sansar.Vector,Sansar.Simulation.PlaySettings)"></span>

```csharp signature
public PlayHandle PlaySoundAtPosition(
    SoundResource soundResource,
    Sansar.Vector position,
    PlaySettings playSettings
)
```

Play sound at specified position.

| Parameter | Type | Description |
|---|---|---|
| `soundResource` | [SoundResource](/scripting/api/sansar.simulation/soundresource) | The sound resource to play. |
| `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The absolute position. |
| `playSettings` | [PlaySettings](/scripting/api/sansar.simulation/playsettings) | The play parameters. |

**Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.

<details class="api-remarks"><summary>Remarks</summary>

Plays for this agent only.  By setting an absolute position, the location of this sound will be static.  If you want the sound to move, you must play the sound on an audio component and move the audio component.

</details>

</div>

### PlaySoundOnComponent

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.PlaySoundOnComponent(Sansar.Simulation.SoundResource,Sansar.Simulation.AudioComponent,Sansar.Simulation.PlaySettings)"></span>

```csharp signature
public PlayHandle PlaySoundOnComponent(
    SoundResource soundResource,
    AudioComponent audioComponent,
    PlaySettings playSettings
)
```

Play sound on a component (and follows its position).

| Parameter | Type | Description |
|---|---|---|
| `soundResource` | [SoundResource](/scripting/api/sansar.simulation/soundresource) | The sound resource to play. |
| `audioComponent` | [AudioComponent](/scripting/api/sansar.simulation/audiocomponent) | The audio component to play this on. |
| `playSettings` | [PlaySettings](/scripting/api/sansar.simulation/playsettings) | The play parameters. |

**Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.

<details class="api-remarks"><summary>Remarks</summary>

Plays for this agent only.  As the component moves, this sound will follow the component&#39;s location.

</details>

</div>

### PlayStream

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.PlayStream(Sansar.Simulation.StreamChannel,System.Single)"></span>

```csharp signature
public PlayHandle PlayStream(
    StreamChannel streamChannel,
    float loudness
)
```

Play audio stream to direct output.

| Parameter | Type | Description |
|---|---|---|
| `streamChannel` | [StreamChannel](/scripting/api/sansar.simulation/streamchannel) | Channel of the audio stream to play. |
| `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative loudness in dB. |

**Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.

<details class="api-remarks"><summary>Remarks</summary>

Plays for this agent only.

</details>

</div>

### PlayStreamAtPosition

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.PlayStreamAtPosition(Sansar.Simulation.StreamChannel,Sansar.Vector,System.Single)"></span>

```csharp signature
public PlayHandle PlayStreamAtPosition(
    StreamChannel streamChannel,
    Sansar.Vector position,
    float loudness
)
```

Play web audio stream at specified position.

| Parameter | Type | Description |
|---|---|---|
| `streamChannel` | [StreamChannel](/scripting/api/sansar.simulation/streamchannel) | Channel of the audio stream to play. |
| `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The absolute position. |
| `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative loudness in dB. |

**Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.

<details class="api-remarks"><summary>Remarks</summary>

Plays for this agent only.  By setting an absolute position, the location of this sound will be static.  If you want the sound to move, you must play the sound on an audio component and move the audio component.

</details>

</div>

### PlayStreamOnComponent

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.PlayStreamOnComponent(Sansar.Simulation.StreamChannel,Sansar.Simulation.AudioComponent,System.Single)"></span>

```csharp signature
public PlayHandle PlayStreamOnComponent(
    StreamChannel streamChannel,
    AudioComponent audioComponent,
    float loudness
)
```

Play web audio stream on this component (and follow its position).

| Parameter | Type | Description |
|---|---|---|
| `streamChannel` | [StreamChannel](/scripting/api/sansar.simulation/streamchannel) | Channel of the audio stream to play. |
| `audioComponent` | [AudioComponent](/scripting/api/sansar.simulation/audiocomponent) | The audio component to play this on. |
| `loudness` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Relative loudness in dB. |

**Returns:** [PlayHandle](/scripting/api/sansar.simulation/playhandle) — The play handle for controlling playback.

<details class="api-remarks"><summary>Remarks</summary>

Plays for this agent only.  As the component moves, this sound will follow the component&#39;s location.

</details>

</div>

### RemoveReaction

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.RemoveReaction(System.String)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 43.2.1</span></div>

```csharp signature
public void RemoveReaction(string reactionType)
```

Remove the specified reaction from this agent.

| Parameter | Type | Description |
|---|---|---|
| `reactionType` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A string that gets passed to the callback.  Should be of a form like &#39;Developer.Type&#39; to match the default, e.g. &#39;Sansar.Fire&#39; |

</div>

### SendChat

<div class="api-card" id="sendchat-string">
<span id="M:Sansar.Simulation.AgentPrivate.SendChat(System.String)"></span>

```csharp signature
public void SendChat(string message)
```

Sends a [`String`](https://learn.microsoft.com/dotnet/api/system.string) message to the $className$.

| Parameter | Type | Description |
|---|---|---|
| `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to send. |

**Throws** [`NullReferenceException`](https://learn.microsoft.com/dotnet/api/system.nullreferenceexception): If the user is no longer online.

**Throws** [`ThrottleException`](/scripting/api/sansar.script/throttleexception): If the throttle rate is exceeded.

<details class="api-remarks"><summary>Remarks</summary>

eprecated. Use AgentPrivate.SendChat or AgentPublic.SendChat

</details>

</div>

<div class="api-card" id="sendchat-string-action">
<span id="M:Sansar.Simulation.AgentPrivate.SendChat(System.String,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

```csharp signature
public void SendChat(
    string message,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sends a [`String`](https://learn.microsoft.com/dotnet/api/system.string) message to the AgentPrivate.

| Parameter | Type | Description |
|---|---|---|
| `message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The message to send. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

Messages may be throttled and ignored.

</details>

</div>

### SetAllowFlight

<div class="api-card" id="setallowflight-boolean">
<span id="M:Sansar.Simulation.AgentPrivate.SetAllowFlight(System.Boolean)"></span>
<div class="api-badges"><span class="api-badge api-new">New in 47.10.0</span></div>

```csharp signature
public void SetAllowFlight(bool allowFlight)
```

Sets whether flying is available for this agent.

| Parameter | Type | Description |
|---|---|---|
| `allowFlight` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to allow this agent to fly, false to prevent it. |

<details class="api-remarks"><summary>Remarks</summary>

The explicit override persists until cleared or the agent leaves, even when the instance default changes. It is per instance, not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.

</details>

</div>

<div class="api-card" id="setallowflight-boolean-action">
<span id="M:Sansar.Simulation.AgentPrivate.SetAllowFlight(System.Boolean,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-new">New in 47.10.0</span></div>

```csharp signature
public void SetAllowFlight(
    bool allowFlight,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sets whether flying is available for this agent.

| Parameter | Type | Description |
|---|---|---|
| `allowFlight` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to allow this agent to fly, false to prevent it. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

The explicit override persists until cleared or the agent leaves, even when the instance default changes. It is per instance, not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.

</details>

</div>

### SetColorLut

<div class="api-card" id="setcolorlut-textureresource">
<span id="M:Sansar.Simulation.AgentPrivate.SetColorLut(Sansar.Simulation.TextureResource)"></span>
<div class="api-badges"><span class="api-badge api-new">New in 47.10.0</span></div>

```csharp signature
public void SetColorLut(TextureResource lut)
```

Overrides the color LUT for this agent alone.

| Parameter | Type | Description |
|---|---|---|
| `lut` | [TextureResource](/scripting/api/sansar.simulation/textureresource) | The LUT texture to grade this agent&#39;s view with, or null to clear the override. |

<details class="api-remarks"><summary>Remarks</summary>

Takes precedence over the LUT chosen in the scene settings and over [`ScenePrivate.SetColorLut`](/scripting/api/sansar.simulation/sceneprivate#setcolorlut-textureresource). A PostFX volume with its own LUT still takes over while this agent&#39;s camera is inside it. The override persists until cleared or the agent leaves. It is per instance, not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.

</details>

</div>

<div class="api-card" id="setcolorlut-textureresource-action">
<span id="M:Sansar.Simulation.AgentPrivate.SetColorLut(Sansar.Simulation.TextureResource,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-new">New in 47.10.0</span></div>

```csharp signature
public void SetColorLut(
    TextureResource lut,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Overrides the color LUT for this agent alone.

| Parameter | Type | Description |
|---|---|---|
| `lut` | [TextureResource](/scripting/api/sansar.simulation/textureresource) | The LUT texture to grade this agent&#39;s view with, or null to clear the override. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

Takes precedence over the LUT chosen in the scene settings and over [`ScenePrivate.SetColorLut`](/scripting/api/sansar.simulation/sceneprivate#setcolorlut-textureresource). A PostFX volume with its own LUT still takes over while this agent&#39;s camera is inside it. The override persists until cleared or the agent leaves. It is per instance, not saved to the world or shared with clone regions. The write is queued for the next world update. The callback, or [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) in a coroutine, reports whether the server committed the change and queued the client update, not client acknowledgment; it fails if the agent has left.

</details>

</div>

### SetGravityFactor

<div class="api-card" id="setgravityfactor-single">
<span id="M:Sansar.Simulation.AgentPrivate.SetGravityFactor(System.Single)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 34.2.0</span></div>

```csharp signature
public void SetGravityFactor(float gravityFactor)
```

Sets what factor of the world&#39;s gravity is applied to this agent.

| Parameter | Type | Description |
|---|---|---|
| `gravityFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravityFactor. Default value is 1, range is clamped between -2 to 2 |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="setgravityfactor-single-action">
<span id="M:Sansar.Simulation.AgentPrivate.SetGravityFactor(System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 34.2.0</span></div>

```csharp signature
public void SetGravityFactor(
    float gravityFactor,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sets what factor of the world&#39;s gravity is applied to this agent.

| Parameter | Type | Description |
|---|---|---|
| `gravityFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravityFactor. Default value is 1, range is clamped between -2 to 2 |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

### SetRagdollBounce

<div class="api-card" id="setragdollbounce-single">
<span id="M:Sansar.Simulation.AgentPrivate.SetRagdollBounce(System.Single)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void SetRagdollBounce(float bounce)
```

Sets the bounciness of the ragdoll body.

| Parameter | Type | Description |
|---|---|---|
| `bounce` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Bounce factor from 0 (no bounce) to 1 (maximum bounce). Default is 0. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="setragdollbounce-single-action">
<span id="M:Sansar.Simulation.AgentPrivate.SetRagdollBounce(System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void SetRagdollBounce(
    float bounce,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sets the bounciness of the ragdoll body.

| Parameter | Type | Description |
|---|---|---|
| `bounce` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Bounce factor from 0 (no bounce) to 1 (maximum bounce). Default is 0. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

### SetRagdollEnabled

<div class="api-card" id="setragdollenabled-boolean">
<span id="M:Sansar.Simulation.AgentPrivate.SetRagdollEnabled(System.Boolean)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void SetRagdollEnabled(bool enabled)
```

Enables or disables ragdoll physics on this agent.

| Parameter | Type | Description |
|---|---|---|
| `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to enable ragdoll, false to disable. |

<details class="api-remarks"><summary>Remarks</summary>

Enabling ragdoll through this overload uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="setragdollenabled-boolean-action">
<span id="M:Sansar.Simulation.AgentPrivate.SetRagdollEnabled(System.Boolean,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void SetRagdollEnabled(
    bool enabled,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Enables or disables ragdoll physics on this agent.

| Parameter | Type | Description |
|---|---|---|
| `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to enable ragdoll, false to disable. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

Enabling ragdoll through this overload uses the default auto-recovery delay of 2 seconds. This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="setragdollenabled-boolean-single">
<span id="M:Sansar.Simulation.AgentPrivate.SetRagdollEnabled(System.Boolean,System.Single)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void SetRagdollEnabled(
    bool enabled,
    float autoRecoverDelaySeconds
)
```

Enables or disables ragdoll physics on this agent and sets the auto-recovery delay.

| Parameter | Type | Description |
|---|---|---|
| `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to enable ragdoll, false to disable. |
| `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="setragdollenabled-boolean-single-action">
<span id="M:Sansar.Simulation.AgentPrivate.SetRagdollEnabled(System.Boolean,System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void SetRagdollEnabled(
    bool enabled,
    float autoRecoverDelaySeconds,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Enables or disables ragdoll physics on this agent and sets the auto-recovery delay.

| Parameter | Type | Description |
|---|---|---|
| `enabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True to enable ragdoll, false to disable. |
| `autoRecoverDelaySeconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | Seconds before auto-recovery begins. Set to 0 to disable auto-recovery. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

### SetScaleFactor

<div class="api-card" id="setscalefactor-single">
<span id="M:Sansar.Simulation.AgentPrivate.SetScaleFactor(System.Single)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void SetScaleFactor(float scaleFactor)
```

Sets a runtime scale factor for this agent.

| Parameter | Type | Description |
|---|---|---|
| `scaleFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The scaleFactor. Default value is 1, range is clamped between 0.01 to 100 |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="setscalefactor-single-action">
<span id="M:Sansar.Simulation.AgentPrivate.SetScaleFactor(System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void SetScaleFactor(
    float scaleFactor,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sets a runtime scale factor for this agent.

| Parameter | Type | Description |
|---|---|---|
| `scaleFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The scaleFactor. Default value is 1, range is clamped between 0.01 to 100 |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

### SetScaleFactorAnimated

<div class="api-card" id="setscalefactoranimated-single-single">
<span id="M:Sansar.Simulation.AgentPrivate.SetScaleFactorAnimated(System.Single,System.Single)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void SetScaleFactorAnimated(float scaleFactor, float seconds)
```

Sets a runtime scale factor for this agent, interpolating smoothly over the given duration.

| Parameter | Type | Description |
|---|---|---|
| `scaleFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The target scaleFactor. Range is clamped between 0.01 to 100 |
| `seconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The duration in seconds over which to interpolate. If 0 or negative, the change is instant. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. The scale will smoothly transition from the current value to the target over the specified duration using a smooth ease curve. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="setscalefactoranimated-single-single-action">
<span id="M:Sansar.Simulation.AgentPrivate.SetScaleFactorAnimated(System.Single,System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.1.1</span></div>

```csharp signature
public void SetScaleFactorAnimated(
    float scaleFactor,
    float seconds,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sets a runtime scale factor for this agent, interpolating smoothly over the given duration.

| Parameter | Type | Description |
|---|---|---|
| `scaleFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The target scaleFactor. Range is clamped between 0.01 to 100 |
| `seconds` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The duration in seconds over which to interpolate. If 0 or negative, the change is instant. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. The scale will smoothly transition from the current value to the target over the specified duration using a smooth ease curve. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

### SetSpeedFactor

<div class="api-card" id="setspeedfactor-single">
<span id="M:Sansar.Simulation.AgentPrivate.SetSpeedFactor(System.Single)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 36.8.0</span></div>

```csharp signature
public void SetSpeedFactor(float speedFactor)
```

Sets what factor of the base speed to apply to this agent.

| Parameter | Type | Description |
|---|---|---|
| `speedFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The speedFactor. Default value is 1, range is clamped between 0.1 to 4 |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="setspeedfactor-single-action">
<span id="M:Sansar.Simulation.AgentPrivate.SetSpeedFactor(System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 36.8.0</span></div>

```csharp signature
public void SetSpeedFactor(
    float speedFactor,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sets what factor of the base speed to apply to this agent.

| Parameter | Type | Description |
|---|---|---|
| `speedFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The speedFactor. Default value is 1, range is clamped between 0.1 to 4 |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

### ToString

<div class="api-card">
<span id="M:Sansar.Simulation.AgentPrivate.ToString"></span>
<span id="M:Sansar.Simulation.AgentPrivate.ToString()"></span>

```csharp signature
public override string ToString()
```

A string representation of this object.

**Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.

<details class="api-remarks"><summary>Remarks</summary>

The format of this string may change between releases.

</details>

</div>


## Used in examples

- [MoverExample1.cs](/scripting/examples/mover-examples)
- [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector)
- [StatsExample.cs](/scripting/examples/stats-example)
- [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys)
- [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker)
- [AgentGravityExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentGravityExample.cs)
- [AgentScaleExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/AgentScaleExample.cs)
- [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs)
- `CameraShakeExample.cs`
- [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs)
- `ColorLutExample.cs`
- [CommandScreenshot.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CommandScreenshot.cs)

…and 29 more examples in the snapshot.

<p class="api-generated" data-pagefind-ignore>Generated from the Sansar 47.10.0 client ScriptApi snapshot.</p>