# RaycastResult.getTerrainAssetMaterialName

Returns the material hit during the raycast. This is only possible if [RaycastResult.type](../Game-Script-Environment/Userdata/RaycastResult.md#type) is equal to "terrainAsset", otherwise this will return empty.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
raycastResult:getTerrainAssetMaterialName(  )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/RaycastResult.md#getterrainassetmaterialname)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `raycastResult` | [RaycastResult](../Game-Script-Environment/Userdata/RaycastResult.md) | The raycast result. |

**Returns:**

| Type | Description |
| --- | --- |
| string | The material name. |
