Searches the node’s child node subtree for objects intersecting a line segment between two specified points.
- iOS 8.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
An endpoint of the line segment to search along, specified in the node’s local coordinate system.
The other endpoint of the line segment to search along, specified in the node’s local coordinate system.
A dictionary of options affecting the search. See Hit Testing Options Keys for acceptable values.
An array of
SCNHit objects representing search results.
Hit-testing is the process of finding elements of a scene located along a specified line segment in the scene’s coordinate space (or that of a particular node in the scene). For example, you can use this method to determine whether a projectile launched by a game character will hit its target.
To search for the scene element corresponding to a two-dimensional point in the rendered image, use the renderer’s
hit method instead.