<!--
{
  "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/GKAgent/maxSpeed",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKAgent(py)maxSpeed"
  },
  "title" : "maxSpeed"
}
-->

# maxSpeed

The agent’s maximum forward speed, in units per second.

```
var maxSpeed: Float { get set }
```

## Discussion

When an agent evaluates the goals listed in its [`behavior`](/documentation/GameplayKit/GKAgent/behavior) property, the result is an acceleration vector that changes the velocity of the agent. If the magnitude of the new velocity is greater than this value, the velocity is reduced to match this value.

## See Also

[`speed`](/documentation/GameplayKit/GKAgent/speed)

The agent’s current forward speed, in units per second.



---

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)