<!--
{
  "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/addBehavior(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNPhysicsWorld(im)addBehavior:"
  },
  "title" : "addBehavior(_:)"
}
-->

# addBehavior(_:)

Adds a behavior to the physics world.

```
func addBehavior(_ behavior: SCNPhysicsBehavior)
```

## Parameters

`behavior`

The behavior to be added.

## Discussion

Physics behaviors constrain or modify the effects of the physics simulation on sets of physics bodies. For example, the [`SCNPhysicsHingeJoint`](/documentation/SceneKit/SCNPhysicsHingeJoint) behavior causes two bodies to move as if connected by a hinge that pivots around a specific axis, and the [`SCNPhysicsVehicle`](/documentation/SceneKit/SCNPhysicsVehicle) behavior causes a body to roll like a car or other wheeled vehicle.

To use a behavior in your scene, follow these steps:

1. Create [`SCNPhysicsBody`](/documentation/SceneKit/SCNPhysicsBody) objects and attach them to each node that participates in the behavior.
2. Create and configure a behavior object joining the physics bodies. See [`SCNPhysicsBehavior`](/documentation/SceneKit/SCNPhysicsBehavior) for a list of behavior classes.
3. Call [`addBehavior(_:)`](/documentation/SceneKit/SCNPhysicsWorld/addBehavior(_:)) on your scene’s physics world object to add the behavior to the physics simulation.

---

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)