# CollisionData

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

Handler for rigid body events.

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

## Members at a glance

| Kind | Members |
|---|---|
| **Properties** | [ComponentId](#componentid) · [EventType](#eventtype) · [HitComponentId](#hitcomponentid) · [HitControlPoint](#hitcontrolpoint) · [HitObject](#hitobject) · [Phase](#phase) |
| **Methods** | [ToString](#tostring) |

## Properties

### ComponentId

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

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

The id of the rigid body component.

</div>

### EventType

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

```csharp signature
public CollisionEventType EventType { get; }
```

The type of collision which occurred.

</div>

### HitComponentId

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

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

The id of the rigid body component or character that was hit.

</div>

### HitControlPoint

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

```csharp signature
public ControlPointType HitControlPoint { get; }
```

The specific control point hit, if any

</div>

### HitObject

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

```csharp signature
public ObjectPublic HitObject { get; }
```

The [`ObjectPublic`](/scripting/api/sansar.simulation/objectpublic) that was hit.

</div>

### Phase

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

```csharp signature
public CollisionEventPhase Phase { get; }
```

used by trigger events to determine if trigger enter or exit occurred

</div>


## Methods

### ToString

<div class="api-card">
<span id="M:Sansar.Simulation.CollisionData.ToString"></span>
<span id="M:Sansar.Simulation.CollisionData.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)
- [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)
- [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)
- [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)
- [ScriptLibrary/Quest/QuestObjectInteraction.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectInteraction.cs)
- [ScriptLibrary/Quest/QuestObjectTrigger.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Quest/QuestObjectTrigger.cs)
- [ScriptLibrary/Scene/Collisions.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/ScriptLibrary/Scene/Collisions.cs)

…and 2 more examples in the snapshot.

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