<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNPhysicsWorld/contactTest(with:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNPhysicsWorld(im)contactTestWithBody:options:"
  },
  "title" : "contactTest(with:options:)"
}
-->

# contactTest(with:options:)

Checks for contacts between one physics body and any other bodies in the physics world.

```
func contactTest(with body: SCNPhysicsBody, options: [SCNPhysicsWorld.TestOption : Any]? = nil) -> [SCNPhysicsContact]
```

## Parameters

`body`

The body to test for contact.

`options`

A dictionary of options affecting the test, or `nil` to use default options. For applicable keys and the possible values, see `Physics Test Options Keys`.

## Return Value

An array of [`SCNPhysicsContact`](/documentation/SceneKit/SCNPhysicsContact) objects describing contacts between the specified body and any others, or `nil` if the body is not in contact with any other bodies.

## Discussion

SceneKit sends messages to the physics world’s contactdelegate object only when collisions occur between bodies whose [`collisionBitMask`](/documentation/SceneKit/SCNPhysicsBody/collisionBitMask) and [`categoryBitMask`](/documentation/SceneKit/SCNPhysicsBody/categoryBitMask) properties overlap, and only for collisions between certain types of bodies. (For details, see [`SCNPhysicsBodyType`](/documentation/SceneKit/SCNPhysicsBodyType).) Use this method to directly test for all contacts between one body and any other bodies at a time of your choosing. For example, to implement a game with a “wall jump” effect, you could call this method when the player presses the jump button to see if the player character is in contact with any walls.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)