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

# speed

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

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

## Discussion

This property measures only the agent’s speed in the direction it faces. The concrete subclasses of [`GKAgent`](/documentation/GameplayKit/GKAgent) relate speed to orientation and position; see the [`velocity`](/documentation/GameplayKit/GKAgent2D/velocity) ([`GKAgent2D`](/documentation/GameplayKit/GKAgent2D)) or [`velocity`](/documentation/GameplayKit/GKAgent3D/velocity) ([`GKAgent3D`](/documentation/GameplayKit/GKAgent3D)) property for the appropriate subclass.

---

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)