Appearance
CollisionCastHit
Result from scene.raycast() when ray intersects an entity or scene mesh
Properties
distance read-only
- Type: number
- Distance from ray origin to hit point
faceIndex read-only
- Type: number | null
- Index of the triangle face that was hit (iOS 18+, mesh collisions only)
normal read-only
- Type: Vector3
- Surface normal at hit point
position read-only
- Type: Vector3
- World-space position where ray hit the entity
representation read-only
- Type: RepresentationEntity
- The entity that was hit (nil for scene mesh hits)
shapeIndex read-only
- Type: number | null
- Index of the shape within the entity that was hit (iOS 18+)
type read-only
- Type: string
- Hit type - "representation" or "sceneMesh"
uv read-only
- Type: Vector2
- Barycentric UV coordinate on the triangle (iOS 18+, mesh collisions only)