Tells the delegate that an agent has just performed a simulation step.
SDKs
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- Gameplay
Kit
Declaration
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
and rotation
properties of the agent (as a GKAgent2D
or GKAgent3D
object), then set the corresponding attributes of the object that provides the agent’s visual representation.