<!--
{
  "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/agentDidUpdate(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKAgentDelegate(im)agentDidUpdate:"
  },
  "title" : "agentDidUpdate(_:)"
}
-->

# agentDidUpdate(_:)

Tells the delegate that an agent has just performed a simulation step.

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

## Parameters

`agent`

The agent object that has just performed a simulation step.

## Discussion

Implement this method when you want to update a display based on the latest data from the agent simulation. Read 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), then set the corresponding attributes of the object that provides the agent’s visual representation.

---

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)