---
title: "init(behaviors:)"
framework: gameplaykit
role: symbol
role_heading: Initializer
path: "gameplaykit/gkcompositebehavior/init(behaviors:)"
---

# init(behaviors:)

Creates a composite behavior from the specified individual behaviors.

## Declaration

```swift
convenience init(behaviors: [GKBehavior])
```

## Parameters

- `behaviors`: An array of behavior objects.

## Return Value

Return Value A new behavior object. To assign a behavior to an agent, use the agent’s behavior property.

## Discussion

Discussion The new behavior contains the specified behaviors, each with a weight of 1.0. To change an individual behavior’s weight after creating the composite behavior, keep a reference to that behavior and use the setWeight(_:for:) method. For more information, see GameplayKit Programming Guide.

## See Also

### Creating a Composite Behavior

- [init(behaviors:andWeights:)](gameplaykit/gkcompositebehavior/init(behaviors:andweights:).md)
