---
title: "update(deltaTime:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gkagent2d/update(deltatime:)"
---

# update(deltaTime:)

Causes the agent to evaluate its goals and update its position, rotation, and velocity accordingly.

## Declaration

```swift
func update(deltaTime seconds: TimeInterval)
```

## Discussion

Discussion You call this method directly on an individual agent, or on all the agents in your game through a GKComponentSystem object, whenever you want to run a step of the agent simulation. Typically, a game updates its agent simulation whenever it prepares to draw a new frame—for example, in the update(_:) method of a SpriteKit SKScene object.

## See Also

### Running the Agent Simulation

- [velocity](gameplaykit/gkagent2d/velocity.md)
