<!--
{
  "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/SCNPhysicsBody/init(type:shape:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNPhysicsBody(cm)bodyWithType:shape:"
  },
  "title" : "init(type:shape:)"
}
-->

# init(type:shape:)

Creates a physics body with the specified type and shape.

```
convenience init(type: SCNPhysicsBodyType, shape: SCNPhysicsShape?)
```

## Parameters

`type`

A constant that determines how a body responds to forces and collisions. See [`SCNPhysicsBodyType`](/documentation/SceneKit/SCNPhysicsBodyType).

`shape`

A physics shape defining the volume of the body for collision detection purposes.

## Return Value

A new physics body object.

## Discussion

For the body to participate in collision detection or respond to forces, you must attach it to the [`physicsBody`](/documentation/SceneKit/SCNNode/physicsBody) property of an [`SCNNode`](/documentation/SceneKit/SCNNode) object in a scene.

If you pass `nil` for the shape parameter, SceneKit automatically creates a physics shape for the body when you attach it to a node, based on that node’s [`geometry`](/documentation/SceneKit/SCNNode/geometry) property. To create a physics shape that’s based on the geometries of a node and its hierarchy of children, or to control the level of detail in a physics shape, create the physics shape manually using an [`SCNPhysicsShape`](/documentation/SceneKit/SCNPhysicsShape) class method.

> Note:
> For nodes containing custom geometry, the physics shape SceneKit automatically creates is a rough approximation of the geometry. This approximation, or *convex hull*, provides a compromise between accuracy and performance in collision detection. For the best collision detection performance, create an ``doc://com.apple.scenekit/documentation/SceneKit/SCNPhysicsShape`` instance based on a basic geometry class (``doc://com.apple.scenekit/documentation/SceneKit/SCNBox``, ``doc://com.apple.scenekit/documentation/SceneKit/SCNSphere``, ``doc://com.apple.scenekit/documentation/SceneKit/SCNPyramid``, ``doc://com.apple.scenekit/documentation/SceneKit/SCNCone``, ``doc://com.apple.scenekit/documentation/SceneKit/SCNCylinder``, or ``doc://com.apple.scenekit/documentation/SceneKit/SCNCapsule``).

## See Also

[`type`](/documentation/SceneKit/SCNPhysicsBody/type)

A constant that determines how the physics body responds to forces and collisions.

[`physicsShape`](/documentation/SceneKit/SCNPhysicsBody/physicsShape)

An object that defines the solid volume of the physics body for use in collision detection.



---

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)