# HeldObjectData

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/eventdata">Sansar.Script.EventData</a></span>
</div>

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

Handler for agent grab events.

```csharp
public class HeldObjectData : Sansar.Script.EventData
```

## Members at a glance

| Kind | Members |
|---|---|
| **Properties** | [ComponentId](#componentid) · [HeldObjectEvent](#heldobjectevent) · [HeldObjectInfo](#heldobjectinfo) · [ObjectId](#objectid) |
| **Methods** | [ToString](#tostring) |

## Properties

### ComponentId

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

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

The ComponentId of the held object&#39;s [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent).

</div>

### HeldObjectEvent

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

```csharp signature
public HeldObjectEventType HeldObjectEvent { get; }
```

The type of held object event which occurred.

</div>

### HeldObjectInfo

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

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

information about the held object

</div>

### ObjectId

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

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

The ObjectId of the held object.

</div>


## Methods

### ToString

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

- [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs)
- [PewPewExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/PewPewExample.cs)
- [ScriptLibrary/Scene/GrabRelease.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/GrabRelease.cs)
- [ScriptLibrary/Scene/Selector.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Selector.cs)
- [ScriptLibrary/Scene/Targeting.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Targeting.cs)

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