# SPhysicsHit

## Index

### Properties Index

| Property                                   |
| ------------------------------------------ |
| SGameObject [**Object** ](#object)`get`    |
| SVector [**Position** ](#position)`get`    |
| SVector [**Normal** ](#normal)`get`        |
| SVector [**UV** ](#uv)`get`                |
| SVector [**UV2** ](#uv2)`get`              |
| float [**Distance** ](#distance)`get`      |
| bool [**ContainsHit** ](#containshit)`get` |

## Properties

### Object

[SGameObject ](https://docs.sine.space/scripting/client-scripting-api-reference/types/sgameobject)**Object** `get`

*Property Description*

{% tabs %}
{% tab title="Lua" %}

```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)

hitGameObject = hit.Object
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Lua" %}

```lua
example 2
```

{% endtab %}
{% endtabs %}

### Position

[SVector](https://docs.sine.space/scripting/client-scripting-api-reference/types/svector) **Position** `get`

*Where the physics hit occurred*

{% tabs %}
{% tab title="Lua" %}

```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)

hitPosition = hit.Position
```

{% endtab %}
{% endtabs %}

### Normal

[SVector](https://docs.sine.space/scripting/client-scripting-api-reference/types/svector) **Normal** `get`

*The normal of the hit*

{% tabs %}
{% tab title="Lua" %}

```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)

hitNormal = hit.Normal
```

{% endtab %}
{% endtabs %}

### UV

SVector **UV** `get`

*The UV coordinates of where the hit occurred on a mesh.*&#x20;

{% hint style="danger" %}
This property will currently always return \[0,0] due to a current bug.
{% endhint %}

{% tabs %}
{% tab title="Lua" %}

```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)

hitUV = hit.UV
```

{% endtab %}
{% endtabs %}

### UV2

SVector **UV2** `get`

*The UV2 coordinates of where the hit occurred on a mesh.*

{% hint style="danger" %}
This property will currently always return \[0,0] due to a current bug.
{% endhint %}

{% tabs %}
{% tab title="Lua" %}

```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)

hitUV2 = hit.UV2
```

{% endtab %}
{% endtabs %}

### Distance

float **Distance** `get`

*How far down a ray or from the collider, the hit occurred*

{% tabs %}
{% tab title="Lua" %}

```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)

hitDistance = hit.Distance
```

{% endtab %}
{% endtabs %}

### ContainsHit

bool **ContainsHit** `get`

*Whether it was a hit or not*

{% tabs %}
{% tab title="Lua" %}

```lua
this = Space.Host.ExecutingObject
hit = Space.Physics.RayCastSingle(this.WorldPosition,this.Forward,20)

hitContainsHit = hit.ContainsHit
```

{% endtab %}
{% endtabs %}
