Unity Raycast
unity_raycastCast a ray in Unity 3D space using Physics.Raycast to detect collisions and return hit data.
Instructions
Cast a ray in Unity 3D space using Physics.Raycast and return hit info.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"origin": "<origin>",
"direction": "<direction>"
},
"name": "unity_raycast"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| origin | Yes | Ray origin. | |
| direction | Yes | Ray direction. | |
| maxDistance | No | Maximum ray distance. | |
| layerMask | No | Layer mask (-1 for all layers). | |
| timeoutMs | No | Command timeout. |