<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKAgentDelegate/agentWillUpdate(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKAgentDelegate(im)agentWillUpdate:"
  },
  "title" : "agentWillUpdate(_:)"
}
-->

# agentWillUpdate(_:)

Tells the delegate that an agent is about to perform its next simulation step.

```
optional func agentWillUpdate(_ agent: GKAgent)
```

## Parameters

`agent`

The agent object that will perform its next simulation step.

## Discussion

Implement this method when you want to update the agent simulation with data from an external source, such as node position and orientation information updated by the SceneKit or SpriteKit physics engine. Set the [`position`](/documentation/GameplayKit/GKAgent2D/position) and [`rotation`](/documentation/GameplayKit/GKAgent2D/rotation) properties of the agent (as a [`GKAgent2D`](/documentation/GameplayKit/GKAgent2D) or [`GKAgent3D`](/documentation/GameplayKit/GKAgent3D) object) so that the next simulation step will take your changes to those properties into account.

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)