agentWillUpdate(_:)
Tells the delegate that an agent is about to perform its next simulation step.
Declaration
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 and rotation properties of the agent (as a GKAgent2D or GKAgent3D object) so that the next simulation step will take your changes to those properties into account.
For more information, see GameplayKit Programming Guide.