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