---
title: "atPoint(_:)"
framework: spritekit
role: symbol
role_heading: Instance Method
path: "spritekit/sknode/atpoint(_:)"
---

# atPoint(_:)

Returns the deepest visible descendant that intersects a point.

## Declaration

```swift
func atPoint(_ p: CGPoint) -> SKNode
```

## Parameters

- `p`: A point in the node’s coordinate system.

## Mentioned in

Controlling User Interaction on Nodes Understanding Hit-Testing

## Return Value

Return Value A descendant in the subtree that intersects the point, or the receiver if no nodes intersect the point. Only nodes that have an isHidden of false and an alpha greater that zero are returned. If multiple descendants intersect the point, the deepest node in the tree is returned. If multiple nodes are at the same level, the intersecting node with the largest z position is returned.

## Discussion

Discussion A point is considered to be in a node if it lies inside the rectangle returned by the calculateAccumulatedFrame() method.

## See Also

### Hit Testing

- [Understanding Hit-Testing](spritekit/understanding-hit-testing.md)
- [contains(_:)](spritekit/sknode/contains(_:).md)
- [nodes(at:)](spritekit/sknode/nodes(at:).md)
