---
title: "init(goals:)"
framework: gameplaykit
role: symbol
role_heading: Initializer
path: "gameplaykit/gkbehavior/init(goals:)"
---

# init(goals:)

Creates a behavior with the specified goals.

## Declaration

```swift
convenience init(goals: [GKGoal])
```

## Parameters

- `goals`: An array of goal objects.

## Return Value

Return Value A new behavior object. To assign a set of goals to an agent, use its behavior property.

## Discussion

Discussion The new behavior contains the specified goals, each with a weight of 1.0. To change a goal’s weight after creating the behavior, keep a reference to that goal and use the setWeight(_:for:) method.

## See Also

### Creating a Behavior

- [init(goal:weight:)](gameplaykit/gkbehavior/init(goal:weight:).md)
- [init(goals:andWeights:)](gameplaykit/gkbehavior/init(goals:andweights:).md)
- [init(weightedGoals:)](gameplaykit/gkbehavior/init(weightedgoals:).md)
