entity(at:in:)
Finds the first entity hit when projecting a ray from a starting point.
Declaration
func entity(at point: CGPoint, in space: some CoordinateSpaceProtocol) -> Entity?Parameters
- point:
A point in the provided coordinate space.
- space:
The 2D coordinate space in which to interpret the
point.
Return Value
The entity at point. Returns nil if no entity was found.