# sm.physics.raycastTarget

Performs a <a target="_blank" href="https://en.wikipedia.org/wiki/Ray_casting">ray cast</a> between two positions to find a specific target.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
sm.physics.raycastTarget( start, end, body, world?, ignoreUuids? )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.physics.md#raycasttarget)

a [Body](../Game-Script-Environment/Userdata/Body.md) must be provided as a target.

The returned [RaycastResult](../Game-Script-Environment/Userdata/RaycastResult.md) contains information about any object intersected by the ray.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `start` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The start position. |
| `end` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The end position. |
| `body` | [Body](../Game-Script-Environment/Userdata/Body.md) | The body to be exclusively checked. |
| `world` *(optional)* | [World](../Game-Script-Environment/Userdata/World.md) | The world to perform the raycast in. (Optional) |
| `ignoreUuids` *(optional)* | table | A table of uuids \{[Uuid](../Game-Script-Environment/Userdata/Uuid.md), ...\} of [Shape](../Game-Script-Environment/Userdata/Shape.md), [Harvestable](../Game-Script-Environment/Userdata/Harvestable.md) or [Character](../Game-Script-Environment/Userdata/Character.md) type to be ignored. (Optional) |

**Returns:**

| Type | Description |
| --- | --- |
| boolean | True if raycast was successful |
| [RaycastResult](../Game-Script-Environment/Userdata/RaycastResult.md) | The raycast result data. |
