# RayCastHit

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

<div class="api-meta">
<span class="api-kind api-kind-struct" data-pagefind-filter="kind:Struct">Struct</span>
<span data-pagefind-filter="namespace:Sansar.Simulation">Namespace <a href="/scripting/api/sansar.simulation"><code>Sansar.Simulation</code></a></span>
</div>

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

Result of a Raycast.

```csharp
public struct RayCastHit
```

## Members at a glance

| Kind | Members |
|---|---|
| **Fields** | [ComponentId](#componentid) · [Fraction](#fraction) · [Location](#location) · [Normal](#normal) |

## Fields

### ComponentId

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

```csharp signature
public Sansar.Script.ComponentId ComponentId
```

The id of the [`RigidBodyComponent`](/scripting/api/sansar.simulation/rigidbodycomponent) hit.

</div>

### Fraction

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

```csharp signature
public float Fraction
```

The query shape&#39;s position (upon contact) along the cast direction as a fraction of the original casting length.

</div>

### Location

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

```csharp signature
public Sansar.Vector Location
```

The location where the hit occurred.

</div>

### Normal

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

```csharp signature
public Sansar.Vector Normal
```

The normal at the location where the hit occurred.

</div>




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