<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKCompositeBehavior/init(behaviors:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKCompositeBehavior(cm)behaviorWithBehaviors:"
  },
  "title" : "init(behaviors:)"
}
-->

# init(behaviors:)

Creates a composite behavior from the specified individual behaviors.

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

## Parameters

`behaviors`

An array of behavior objects.

## Return Value

A new behavior object. To assign a behavior to an agent, use the agent’s [`behavior`](/documentation/GameplayKit/GKAgent/behavior) property.

## 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:)`](/documentation/GameplayKit/GKCompositeBehavior/setWeight(_:for:)) method.

For more information, see [GameplayKit Programming Guide](https://developer.apple.com/library/archive/documentation/General/Conceptual/GameplayKit_Guide/index.html#//apple_ref/doc/uid/TP40015172).

---

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)