# RigidBodyComponent

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.RigidBodyComponent"></span>

The RigidBodyComponent handles interactions with rigid body physics.

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

## Members at a glance

| Kind | Members |
|---|---|
| **Fields** | [ComponentType](#componenttype) |
| **Properties** | [ComponentId](#componentid) · [Name](#name) |
| **Methods** | [AddAngularImpulse](#addangularimpulse) · [AddLinearImpulse](#addlinearimpulse) · [GetAngularDamping](#getangulardamping) · [GetAngularVelocity](#getangularvelocity) · [GetBounce](#getbounce) · [GetCanGrab](#getcangrab) · [GetCenterOfMass](#getcenterofmass) · [GetColliderCenter](#getcollidercenter) · [GetColliderExtents](#getcolliderextents) · [GetDynamicFriction](#getdynamicfriction) · [GetGravityFactor](#getgravityfactor) · [GetHeldObjectInfo](#getheldobjectinfo) · [GetInverseInertia](#getinverseinertia) · [GetLinearDamping](#getlineardamping) · [GetLinearVelocity](#getlinearvelocity) · [GetMass](#getmass) · [GetMotionType](#getmotiontype) · [GetOrientation](#getorientation) · [GetPosition](#getposition) · [GetSitObjectInfo](#getsitobjectinfo) · [GetStaticFriction](#getstaticfriction) · [IsDynamic](#isdynamic) · [IsTriggerVolume](#istriggervolume) · [ReleaseHeldObject](#releaseheldobject) · [SetAngularDamping](#setangulardamping) · [SetAngularVelocity](#setangularvelocity) · [SetBounce](#setbounce) · [SetCanGrab](#setcangrab) · [SetCenterOfMass](#setcenterofmass) · [SetDynamicFriction](#setdynamicfriction) · [SetGravityFactor](#setgravityfactor) · [SetInverseInertia](#setinverseinertia) · [SetLinearDamping](#setlineardamping) · [SetLinearVelocity](#setlinearvelocity) · [SetMass](#setmass) · [SetMotionType](#setmotiontype) · [SetOrientation](#setorientation) · [SetPosition](#setposition) · [SetStaticFriction](#setstaticfriction) · [Subscribe](#subscribe) · [SubscribeToHeldObject](#subscribetoheldobject) · [SubscribeToSitObject](#subscribetositobject) · [ToString](#tostring) |

## Fields

### ComponentType

<div class="api-card">
<span id="F:Sansar.Simulation.RigidBodyComponent.ComponentType"></span>

```csharp signature
public static readonly ComponentType ComponentType
```

The [`RigidBodyComponent.ComponentType`](/scripting/api/sansar.simulation/rigidbodycomponent#componenttype) of this component

</div>


## Properties

### ComponentId

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

```csharp signature
public Sansar.Script.ComponentId ComponentId { get; }
```

Retrieves the component id for this RigidBodyComponent.

**Value:** [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) — The id.

</div>

### Name

<div class="api-card">
<span id="P:Sansar.Simulation.RigidBodyComponent.Name"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 33.2.0</span></div>

```csharp signature
public string Name { get; }
```

This RigidBodyComponent name, as specified in the editor.

</div>


## Methods

### AddAngularImpulse

<div class="api-card" id="addangularimpulse-vector">
<span id="M:Sansar.Simulation.RigidBodyComponent.AddAngularImpulse(Sansar.Vector)"></span>

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

Adds an angular impulse to this RigidBodyComponent.

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

<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="addangularimpulse-vector-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.AddAngularImpulse(Sansar.Vector,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong AddAngularImpulse(
    Sansar.Vector impulse,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Adds an angular impulse to this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="addangularimpulse-vector-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.AddAngularImpulse(Sansar.Vector,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Adds an angular impulse to this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse. |
| `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>

### AddLinearImpulse

<div class="api-card" id="addlinearimpulse-vector">
<span id="M:Sansar.Simulation.RigidBodyComponent.AddLinearImpulse(Sansar.Vector)"></span>

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

Adds a linear impulse the the center of mass of this RigidBodyComponent.

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

<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="addlinearimpulse-vector-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.AddLinearImpulse(Sansar.Vector,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong AddLinearImpulse(
    Sansar.Vector impulse,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Adds a linear impulse the the center of mass of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="addlinearimpulse-vector-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.AddLinearImpulse(Sansar.Vector,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Adds a linear impulse the the center of mass of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `impulse` | [Sansar.Vector](/scripting/api/sansar/vector) | The impulse. |
| `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>

### GetAngularDamping

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

```csharp signature
public float GetAngularDamping()
```

Retrieves the amount of damping applied to this object&#39;s angular motion.

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

</div>

### GetAngularVelocity

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

```csharp signature
public Sansar.Vector GetAngularVelocity()
```

Retrieves the angular velocity for this RigidBodyComponent.

**Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — The velocity.

</div>

### GetBounce

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

```csharp signature
public float GetBounce()
```

Retrieves the bounce of this RigidBodyComponent.

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

</div>

### GetCanGrab

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

```csharp signature
public bool GetCanGrab()
```

The can grab state for this RigidBodyComponent.

**Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — A bool indicating if the object can be picked up.

</div>

### GetCenterOfMass

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

```csharp signature
public Sansar.Vector GetCenterOfMass()
```

Retrieves the center of mass of this object in local space.

**Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — A Vector to the center of mass of this object, in the objects local space.

</div>

### GetColliderCenter

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

```csharp signature
public Sansar.Vector GetColliderCenter()
```

Retrieves the center of the collision shape for this object in local space.

**Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — The center of the collision shape.

</div>

### GetColliderExtents

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

```csharp signature
public Sansar.Vector GetColliderExtents()
```

Retrieves the extents of the collision shape for this object in local space.

**Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — The extents of the collision shape.

</div>

### GetDynamicFriction

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

```csharp signature
public float GetDynamicFriction()
```

Retrieves the dynamic friction of this RigidBodyComponent.

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

</div>

### GetGravityFactor

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

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

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

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

</div>

### GetHeldObjectInfo

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

```csharp signature
public HeldObjectInfo GetHeldObjectInfo()
```

Data about who is holding this RigidBodyComponent.

**Returns:** [HeldObjectInfo](/scripting/api/sansar.simulation/heldobjectinfo) — A [`HeldObjectInfo`](/scripting/api/sansar.simulation/heldobjectinfo) struct.

</div>

### GetInverseInertia

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

```csharp signature
public Sansar.Vector GetInverseInertia()
```

Retrieves the moment of inertia for this object.

**Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — A Vector representation of the inverse moment of inertia.

</div>

### GetLinearDamping

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

```csharp signature
public float GetLinearDamping()
```

Retrieves the amount of damping applied to this object&#39;s linear motion.

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

</div>

### GetLinearVelocity

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

```csharp signature
public Sansar.Vector GetLinearVelocity()
```

Retrieves the linear velocity for this RigidBodyComponent.

**Returns:** [Sansar.Vector](/scripting/api/sansar/vector) — The velocity.

</div>

### GetMass

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

```csharp signature
public float GetMass()
```

Retrieves the mass of this RigidBodyComponent.

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

</div>

### GetMotionType

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

```csharp signature
public RigidBodyMotionType GetMotionType()
```

The motion type for this RigidBodyComponent.

**Returns:** [RigidBodyMotionType](/scripting/api/sansar.simulation/rigidbodymotiontype) — A RigidBodyMotionType enum for the motion type.

</div>

### GetOrientation

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

```csharp signature
public Sansar.Quaternion GetOrientation()
```

Retrieves the orientation of this RigidBodyComponent.

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

</div>

### GetPosition

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

```csharp signature
public Sansar.Vector GetPosition()
```

Retrieves the position of this RigidBodyComponent.

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

</div>

### GetSitObjectInfo

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

```csharp signature
public SitObjectInfo[] GetSitObjectInfo()
```

Data about who is sitting on this RigidBodyComponent.

**Returns:** [SitObjectInfo](/scripting/api/sansar.simulation/sitobjectinfo)\[\] — A [`SitObjectInfo`](/scripting/api/sansar.simulation/sitobjectinfo) struct.

</div>

### GetStaticFriction

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

```csharp signature
public float GetStaticFriction()
```

Retrieves the static friction of this RigidBodyComponent.

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

</div>

### IsDynamic

<div class="api-card">
<span id="M:Sansar.Simulation.RigidBodyComponent.IsDynamic"></span>
<span id="M:Sansar.Simulation.RigidBodyComponent.IsDynamic()"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Use GetMotionType()", false)]
public bool IsDynamic()
```

Whether this rigidbody is dynamic.

**Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if this is a dynamic object.

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

Deprecated. Use GetMotionType() instead.

</details>

</div>

### IsTriggerVolume

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

```csharp signature
public bool IsTriggerVolume()
```

Whether this RigidBodyComponent is a TriggerVolume.

**Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if this RigidBodyComponent is a TriggerVolume.

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

TriggerVolumes can be moved through and generate [`CollisionEventType.cTrigger`](/scripting/api/sansar.simulation/collisioneventtype#F:Sansar.Simulation.CollisionEventType.cTrigger) collision events instead of normal collision events.

</details>

</div>

### ReleaseHeldObject

<div class="api-card" id="releaseheldobject-noargs">
<span id="M:Sansar.Simulation.RigidBodyComponent.ReleaseHeldObject"></span>
<span id="M:Sansar.Simulation.RigidBodyComponent.ReleaseHeldObject()"></span>

```csharp signature
public void ReleaseHeldObject()
```

Force any agent holding this object to drop it.

</div>

<div class="api-card" id="releaseheldobject-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.ReleaseHeldObject(System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 32.0.0</span></div>

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

Force any agent holding this object to drop it.

| 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. |

</div>

### SetAngularDamping

<div class="api-card" id="setangulardamping-single">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetAngularDamping(System.Single)"></span>

```csharp signature
public void SetAngularDamping(float angularDamping)
```

Sets the amount of damping to apply to this object&#39;s angular motion.

| Parameter | Type | Description |
|---|---|---|
| `angularDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angular damping factor. Default value 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="setangulardamping-single-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetAngularDamping(System.Single,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetAngularDamping(
    float angularDamping,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the amount of damping to apply to this object&#39;s angular motion.

| Parameter | Type | Description |
|---|---|---|
| `angularDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angular damping factor. Default value is 0. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="setangulardamping-single-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetAngularDamping(System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the amount of damping to apply to this object&#39;s angular motion.

| Parameter | Type | Description |
|---|---|---|
| `angularDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The angular damping factor. Default value 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>

### SetAngularVelocity

<div class="api-card" id="setangularvelocity-vector">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetAngularVelocity(Sansar.Vector)"></span>

```csharp signature
public void SetAngularVelocity(Sansar.Vector velocity)
```

Sets the angular velocity for this RigidBodyComponent. Angular velocity is clamped between -100m/s and 100m/s.

| Parameter | Type | Description |
|---|---|---|
| `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. |

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

This asynchronous method queues the write then returns. Subsequent calls to [`RigidBodyComponent.GetAngularVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getangularvelocity) will return the previous velocity until the write occurs. 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="setangularvelocity-vector-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetAngularVelocity(Sansar.Vector,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetAngularVelocity(
    Sansar.Vector velocity,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the angular velocity for this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

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

This asynchronous method queues the write then returns. Subsequent calls to [`RigidBodyComponent.GetAngularVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getangularvelocity) will return the previous velocity until the write occurs. 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="setangularvelocity-vector-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetAngularVelocity(Sansar.Vector,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the angular velocity for this RigidBodyComponent. Angular velocity is clamped between -100m/s and 100m/s.

| Parameter | Type | Description |
|---|---|---|
| `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. |
| `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. Subsequent calls to [`RigidBodyComponent.GetAngularVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getangularvelocity) will return the previous velocity until the write occurs. 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>

### SetBounce

<div class="api-card" id="setbounce-single">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetBounce(System.Single)"></span>

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

Sets the bounce of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `bounce` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The bounce factor. Value should be between 0 and 1 (inclusive) |

<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="setbounce-single-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetBounce(System.Single,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetBounce(
    float bounce,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the bounce of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `bounce` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The bounce factor. Value should be between 0 and 1 (inclusive) |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="setbounce-single-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetBounce(System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the bounce of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `bounce` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The bounce factor. Value should be between 0 and 1 (inclusive) |
| `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>

### SetCanGrab

<div class="api-card" id="setcangrab-boolean">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetCanGrab(System.Boolean)"></span>

```csharp signature
public void SetCanGrab(bool canGrab)
```

Sets the can grab state for this rigidbody.

| Parameter | Type | Description |
|---|---|---|
| `canGrab` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Boolean value to indicate if the rigid body can be grabbed. |

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

This method will throw an exception if the rigid body has the static motion type.  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="setcangrab-boolean-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetCanGrab(System.Boolean,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the can grab state for this rigidbody.

| Parameter | Type | Description |
|---|---|---|
| `canGrab` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Boolean value to indicate if the rigid body can be grabbed. |
| `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 method will throw an exception if the rigid body has the static motion type.  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>

### SetCenterOfMass

<div class="api-card" id="setcenterofmass-vector">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetCenterOfMass(Sansar.Vector)"></span>

```csharp signature
public void SetCenterOfMass(Sansar.Vector centerOfMass)
```

Sets the center of mass of this object in local space.

| Parameter | Type | Description |
|---|---|---|
| `centerOfMass` | [Sansar.Vector](/scripting/api/sansar/vector) | A Vector to the center of mass of this object, in the objects local space. |

<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="setcenterofmass-vector-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetCenterOfMass(Sansar.Vector,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetCenterOfMass(
    Sansar.Vector centerOfMass,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the center of mass of this object in local space.

| Parameter | Type | Description |
|---|---|---|
| `centerOfMass` | [Sansar.Vector](/scripting/api/sansar/vector) | A Vector to the center of mass of this object, in the objects local space. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="setcenterofmass-vector-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetCenterOfMass(Sansar.Vector,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the center of mass of this object in local space.

| Parameter | Type | Description |
|---|---|---|
| `centerOfMass` | [Sansar.Vector](/scripting/api/sansar/vector) | A Vector to the center of mass of this object, in the objects local 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 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>

### SetDynamicFriction

<div class="api-card" id="setdynamicfriction-single">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetDynamicFriction(System.Single)"></span>

```csharp signature
public void SetDynamicFriction(float dynamicFriction)
```

Sets the dynamic friction of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `dynamicFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The dynamic friction. Value should be between 0 and 1 (inclusive) |

<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="setdynamicfriction-single-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetDynamicFriction(System.Single,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetDynamicFriction(
    float dynamicFriction,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the dynamic friction of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `dynamicFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The dynamic friction. Value should be between 0 and 1 (inclusive) |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="setdynamicfriction-single-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetDynamicFriction(System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the dynamic friction of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `dynamicFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The dynamic friction. Value should be between 0 and 1 (inclusive) |
| `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>

### SetGravityFactor

<div class="api-card" id="setgravityfactor-single">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetGravityFactor(System.Single)"></span>

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

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

| Parameter | Type | Description |
|---|---|---|
| `gravityFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravityFactor. Default value is 1, range is -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-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetGravityFactor(System.Single,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetGravityFactor(
    float gravityFactor,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

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

| Parameter | Type | Description |
|---|---|---|
| `gravityFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravityFactor. Default value is 1, range is -2 to 2 |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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.RigidBodyComponent.SetGravityFactor(System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

```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 object.

| Parameter | Type | Description |
|---|---|---|
| `gravityFactor` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The gravityFactor. Default value is 1, range is -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>

### SetInverseInertia

<div class="api-card" id="setinverseinertia-vector">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetInverseInertia(Sansar.Vector)"></span>

```csharp signature
public void SetInverseInertia(Sansar.Vector inverseInertia)
```

Sets the moment of inertia for this object.

| Parameter | Type | Description |
|---|---|---|
| `inverseInertia` | [Sansar.Vector](/scripting/api/sansar/vector) | A Vector representation of the inverse moment of inertia for this object in world space. |

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

Setting this to zero in the x and y components, for example, will give this object infinite inertia on the x and y axes and only permit it to rotate around the z axis. 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="setinverseinertia-vector-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetInverseInertia(Sansar.Vector,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the moment of inertia for this object.

| Parameter | Type | Description |
|---|---|---|
| `inverseInertia` | [Sansar.Vector](/scripting/api/sansar/vector) | A Vector representation of the inverse moment of inertia for this object 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>

Setting this to zero in the x and y components, for example, will give this object infinite inertia on the x and y axes and only permit it to rotate around the z axis. 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>

### SetLinearDamping

<div class="api-card" id="setlineardamping-single">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetLinearDamping(System.Single)"></span>

```csharp signature
public void SetLinearDamping(float linearDamping)
```

Sets the amount of damping to apply to this object&#39;s linear motion.

| Parameter | Type | Description |
|---|---|---|
| `linearDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The linear damping factor. Default value 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="setlineardamping-single-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetLinearDamping(System.Single,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetLinearDamping(
    float linearDamping,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the amount of damping to apply to this object&#39;s linear motion.

| Parameter | Type | Description |
|---|---|---|
| `linearDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The linear damping factor. Default value is 0. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="setlineardamping-single-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetLinearDamping(System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the amount of damping to apply to this object&#39;s linear motion.

| Parameter | Type | Description |
|---|---|---|
| `linearDamping` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The linear damping factor. Default value 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>

### SetLinearVelocity

<div class="api-card" id="setlinearvelocity-vector">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetLinearVelocity(Sansar.Vector)"></span>

```csharp signature
public void SetLinearVelocity(Sansar.Vector velocity)
```

Sets the linear velocity for this RigidBodyComponent. Linear velocity is clamped between -200m/s and 200m/s.

| Parameter | Type | Description |
|---|---|---|
| `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. |

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

This asynchronous method queues the write then returns. Subsequent calls to [`RigidBodyComponent.GetLinearVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getlinearvelocity) will return the previous velocity until the write occurs. 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="setlinearvelocity-vector-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetLinearVelocity(Sansar.Vector,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetLinearVelocity(
    Sansar.Vector velocity,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the linear velocity for this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

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

This asynchronous method queues the write then returns. Subsequent calls to [`RigidBodyComponent.GetLinearVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getlinearvelocity) will return the previous velocity until the write occurs. 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="setlinearvelocity-vector-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetLinearVelocity(Sansar.Vector,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the linear velocity for this RigidBodyComponent. Linear velocity is clamped between -200m/s and 200m/s.

| Parameter | Type | Description |
|---|---|---|
| `velocity` | [Sansar.Vector](/scripting/api/sansar/vector) | The velocity. |
| `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. Subsequent calls to [`RigidBodyComponent.GetLinearVelocity`](/scripting/api/sansar.simulation/rigidbodycomponent#getlinearvelocity) will return the previous velocity until the write occurs. 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>

### SetMass

<div class="api-card" id="setmass-single">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetMass(System.Single)"></span>

```csharp signature
public void SetMass(float mass)
```

Sets the mass of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `mass` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The mass. |

<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="setmass-single-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetMass(System.Single,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetMass(
    float mass,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the mass of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `mass` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The mass. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="setmass-single-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetMass(System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the mass of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `mass` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The mass. |
| `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>

### SetMotionType

<div class="api-card" id="setmotiontype-rigidbodymotiontype">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetMotionType(Sansar.Simulation.RigidBodyMotionType)"></span>

```csharp signature
public void SetMotionType(RigidBodyMotionType motionType)
```

Sets the motion type for this rigidbody.

| Parameter | Type | Description |
|---|---|---|
| `motionType` | [RigidBodyMotionType](/scripting/api/sansar.simulation/rigidbodymotiontype) | The motion type. |

<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="setmotiontype-rigidbodymotiontype-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetMotionType(Sansar.Simulation.RigidBodyMotionType,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetMotionType(
    RigidBodyMotionType motionType,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the motion type for this rigidbody.

| Parameter | Type | Description |
|---|---|---|
| `motionType` | [RigidBodyMotionType](/scripting/api/sansar.simulation/rigidbodymotiontype) | The motion type. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="setmotiontype-rigidbodymotiontype-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetMotionType(Sansar.Simulation.RigidBodyMotionType,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

```csharp signature
public void SetMotionType(
    RigidBodyMotionType motionType,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sets the motion type for this rigidbody.

| Parameter | Type | Description |
|---|---|---|
| `motionType` | [RigidBodyMotionType](/scripting/api/sansar.simulation/rigidbodymotiontype) | The motion type. |
| `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>

### SetOrientation

<div class="api-card" id="setorientation-quaternion">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetOrientation(Sansar.Quaternion)"></span>

```csharp signature
public void SetOrientation(Sansar.Quaternion orientation)
```

Sets the orientation of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation. |

<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="setorientation-vector">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetOrientation(Sansar.Vector)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Use SetOrientation(Quaternion)", false)]
public ulong SetOrientation(Sansar.Vector orientation)
```

Sets the orientation of this $className$.

| Parameter | Type | Description |
|---|---|---|
| `orientation` | [Sansar.Vector](/scripting/api/sansar/vector) | The orientation. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

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

Deprecated. Use SetOrientation(Quaternion) instead.

</details>

</div>

<div class="api-card" id="setorientation-quaternion-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetOrientation(Sansar.Quaternion,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetOrientation(
    Sansar.Quaternion orientation,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the orientation of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="setorientation-quaternion-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetOrientation(Sansar.Quaternion,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

```csharp signature
public void SetOrientation(
    Sansar.Quaternion orientation,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sets the orientation of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `orientation` | [Sansar.Quaternion](/scripting/api/sansar/quaternion) | The orientation. |
| `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>

<div class="api-card" id="setorientation-vector-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetOrientation(Sansar.Vector,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Use SetOrientation(Quaternion)", false)]
public ulong SetOrientation(
    Sansar.Vector orientation,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the orientation of this $className$.

| Parameter | Type | Description |
|---|---|---|
| `orientation` | [Sansar.Vector](/scripting/api/sansar/vector) | The orientation. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

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

Deprecated. Use SetOrientation(Quaternion) instead.

</details>

</div>

<div class="api-card" id="setorientation-vector-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetOrientation(Sansar.Vector,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Use SetOrientation(Quaternion)", false)]
public ulong SetOrientation(
    Sansar.Vector orientation,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sets the orientation of this $className$.

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

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

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

Deprecated. Use SetOrientation(Quaternion) instead.

</details>

</div>

### SetPosition

<div class="api-card" id="setposition-vector">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetPosition(Sansar.Vector)"></span>

```csharp signature
public void SetPosition(Sansar.Vector position)
```

Sets the position of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The position. |

<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="setposition-vector-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetPosition(Sansar.Vector,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetPosition(
    Sansar.Vector position,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the position of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The position. |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="setposition-vector-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetPosition(Sansar.Vector,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the position of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `position` | [Sansar.Vector](/scripting/api/sansar/vector) | The position. |
| `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>

### SetStaticFriction

<div class="api-card" id="setstaticfriction-single">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetStaticFriction(System.Single)"></span>

```csharp signature
public void SetStaticFriction(float staticFriction)
```

Sets the static friction of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `staticFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The static friction. Value should be between 0 and 1 (inclusive) |

<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="setstaticfriction-single-operationcomplete">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetStaticFriction(System.Single,Sansar.Script.ScriptBase.OperationComplete)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetStaticFriction(
    float staticFriction,
    Sansar.Script.ScriptBase.OperationComplete handler
)
```

Sets the static friction of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `staticFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The static friction. Value should be between 0 and 1 (inclusive) |
| `handler` | [Sansar.Script.ScriptBase.OperationComplete](/scripting/api/sansar.script/scriptbase.operationcomplete) | Handler to be called when the event completes. |

**Returns:** [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) — The return value is an internal event id.

<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="setstaticfriction-single-action">
<span id="M:Sansar.Simulation.RigidBodyComponent.SetStaticFriction(System.Single,System.Action{Sansar.Script.OperationCompleteEvent})"></span>

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

Sets the static friction of this RigidBodyComponent.

| Parameter | Type | Description |
|---|---|---|
| `staticFriction` | [float](https://learn.microsoft.com/dotnet/api/system.single) | The static friction. Value should be between 0 and 1 (inclusive) |
| `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>

### Subscribe

<div class="api-card" id="subscribe-collisioneventtype-subscriptionhandler-boolean">
<span id="M:Sansar.Simulation.RigidBodyComponent.Subscribe(Sansar.Simulation.CollisionEventType,Sansar.Simulation.RigidBodyComponent.SubscriptionHandler,System.Boolean)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.CollisionData>", false)]
public void Subscribe(
    CollisionEventType EventType,
    RigidBodyComponent.SubscriptionHandler callback,
    bool persistent
)
```

Subscribes to Collision Events.

| Parameter | Type | Description |
|---|---|---|
| `EventType` | [CollisionEventType](/scripting/api/sansar.simulation/collisioneventtype) | The type of collision which occurred. |
| `callback` | [RigidBodyComponent.SubscriptionHandler](/scripting/api/sansar.simulation/rigidbodycomponent.subscriptionhandler) | Callback which is executed when the event completes. |
| `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |

</div>

<div class="api-card" id="subscribe-collisioneventtype-action-boolean">
<span id="M:Sansar.Simulation.RigidBodyComponent.Subscribe(Sansar.Simulation.CollisionEventType,System.Action{Sansar.Simulation.CollisionData},System.Boolean)"></span>

```csharp signature
public Sansar.Script.IEventSubscription Subscribe(
    CollisionEventType EventType,
    Action<CollisionData> callback,
    bool persistent
)
```

Subscribes to Collision Events.

| Parameter | Type | Description |
|---|---|---|
| `EventType` | [CollisionEventType](/scripting/api/sansar.simulation/collisioneventtype) | The type of collision which occurred. |
| `callback` | [Action&lt;CollisionData&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. |
| `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |

**Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.

</div>

<div class="api-card" id="subscribe-collisioneventtype-componentid-subscriptionhandler-boolean">
<span id="M:Sansar.Simulation.RigidBodyComponent.Subscribe(Sansar.Simulation.CollisionEventType,Sansar.Script.ComponentId,Sansar.Simulation.RigidBodyComponent.SubscriptionHandler,System.Boolean)"></span>
<div class="api-badges"><span class="api-badge api-deprecated">Deprecated</span></div>

```csharp signature
[System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.CollisionData>", false)]
public void Subscribe(
    CollisionEventType EventType,
    Sansar.Script.ComponentId HitComponentId,
    RigidBodyComponent.SubscriptionHandler callback,
    bool persistent
)
```

Subscribes to Collision Events.

| Parameter | Type | Description |
|---|---|---|
| `EventType` | [CollisionEventType](/scripting/api/sansar.simulation/collisioneventtype) | The type of collision which occurred. |
| `HitComponentId` | [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) | The id of the rigid body component or character that was hit. |
| `callback` | [RigidBodyComponent.SubscriptionHandler](/scripting/api/sansar.simulation/rigidbodycomponent.subscriptionhandler) | Callback which is executed when the event completes. |
| `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |

</div>

<div class="api-card" id="subscribe-collisioneventtype-componentid-action-boolean">
<span id="M:Sansar.Simulation.RigidBodyComponent.Subscribe(Sansar.Simulation.CollisionEventType,Sansar.Script.ComponentId,System.Action{Sansar.Simulation.CollisionData},System.Boolean)"></span>

```csharp signature
public Sansar.Script.IEventSubscription Subscribe(
    CollisionEventType EventType,
    Sansar.Script.ComponentId HitComponentId,
    Action<CollisionData> callback,
    bool persistent
)
```

Subscribes to Collision Events.

| Parameter | Type | Description |
|---|---|---|
| `EventType` | [CollisionEventType](/scripting/api/sansar.simulation/collisioneventtype) | The type of collision which occurred. |
| `HitComponentId` | [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) | The id of the rigid body component or character that was hit. |
| `callback` | [Action&lt;CollisionData&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. |
| `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |

**Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.

</div>

### SubscribeToHeldObject

<div class="api-card">
<span id="M:Sansar.Simulation.RigidBodyComponent.SubscribeToHeldObject(Sansar.Simulation.HeldObjectEventType,System.Action{Sansar.Simulation.HeldObjectData},System.Boolean)"></span>

```csharp signature
public Sansar.Script.IEventSubscription SubscribeToHeldObject(
    HeldObjectEventType HeldObjectEvent,
    Action<HeldObjectData> callback,
    bool persistent
)
```

Subscribes to HeldObject Events.

| Parameter | Type | Description |
|---|---|---|
| `HeldObjectEvent` | [HeldObjectEventType](/scripting/api/sansar.simulation/heldobjecteventtype) | The type of held object event which occurred. |
| `callback` | [Action&lt;HeldObjectData&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. |
| `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |

**Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.

</div>

### SubscribeToSitObject

<div class="api-card">
<span id="M:Sansar.Simulation.RigidBodyComponent.SubscribeToSitObject(Sansar.Simulation.SitEventType,System.Action{Sansar.Simulation.SitObjectData},System.Boolean)"></span>

```csharp signature
public Sansar.Script.IEventSubscription SubscribeToSitObject(
    SitEventType SitObjectEvent,
    Action<SitObjectData> callback,
    bool persistent
)
```

Subscribes to SitObject Events.

| Parameter | Type | Description |
|---|---|---|
| `SitObjectEvent` | [SitEventType](/scripting/api/sansar.simulation/siteventtype) | The type of sit event which occurred. |
| `callback` | [Action&lt;SitObjectData&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Callback which is executed when the event completes. |
| `persistent` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Optional, set to false to unsubscribe after one event. |

**Returns:** [Sansar.Script.IEventSubscription](/scripting/api/sansar.script/ieventsubscription) — An [`IEventSubscription`](/scripting/api/sansar.script/ieventsubscription) that can be used to cancel the subscription.

</div>

### ToString

<div class="api-card">
<span id="M:Sansar.Simulation.RigidBodyComponent.ToString"></span>
<span id="M:Sansar.Simulation.RigidBodyComponent.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

- [FollowThePath.cs](/scripting/examples/follow-the-path)
- [MoverExample1.cs](/scripting/examples/mover-examples)
- [RandomMovement.cs](/scripting/examples/random-movement)
- [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector)
- [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)
- [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs)
- [ObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ObjectScriptExample.cs)
- [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs)
- [SceneObjectScriptExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/SceneObjectScriptExample.cs)
- [ScriptLibrary/Quest/QuestGiverTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestGiverTrigger.cs)

…and 15 more examples in the snapshot.

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