---
title: "init(inWorldSpace:with:)"
framework: scenekit
role: symbol
role_heading: Initializer
path: "scenekit/scntransformconstraint/init(inworldspace:with:)"
---

# init(inWorldSpace:with:)

Creates a new transform constraint.

## Declaration

```swift
convenience init(inWorldSpace world: Bool, with block: @escaping (SCNNode, SCNMatrix4) -> SCNMatrix4)
```

```swift
convenience init(inWorldSpace world: Bool, with block: @escaping (SCNNode, SCNMatrix4) -> SCNMatrix4)
```

## Parameters

- `world`: doc://com.apple.documentation/documentation/Swift/true to evaluate the constraint in the scene’s world coordinate space, or doc://com.apple.documentation/documentation/Swift/false to evaluate it relative to the local coordinate space of each constrained node.
- `block`: A block to be called when Scene Kit evaluates the constraint. The block takes the following parameters: The block returns a transformation matrix, which Scene Kit then applies to the node. If you return the transform value passed to the block, your constraint has no effect on the node.

## Return Value

Return Value A constraint object.

## Discussion

Discussion The world parameter determines the coordinate space of the transformations passed to and returned by the block parameter.
