body(alongRayStart:end:)
Searches for the first physics body that intersects a ray.
Declaration
func body(alongRayStart start: CGPoint, end: CGPoint) -> SKPhysicsBody?Parameters
- start:
The starting point for the ray in scene coordinates.
- end:
The ending point for the ray in scene coordinates.
Return Value
The first physics body discovered that intersects the ray. This may be any body along the ray; it is not guaranteed to be the closest physics body. If no body intersects the ray, this method returns nil.