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

# position

The current position of the agent in 3D space.

```
var position: vector_float3 { get set }
```

## Discussion

The agent updates its own position, rotation, and velocity according to its goals when you call its [`update(deltaTime:)`](/documentation/GameplayKit/GKAgent3D/update(deltaTime:)) method.

However, you can still directly change the position of an agent. Do this when you want to set the position of a static agent (that is, one with no goals) or move an agent as a direct result of user input. For example, to make a game character follow a touch (in iOS) or the mouse pointer (in macOS), you can create an invisible agent and continually update that agent’s position to match that of the touch or mouse event. Then, give the agent representing the game character a goal created with the [`init(toSeekAgent:)`](/documentation/GameplayKit/GKGoal/init(toSeekAgent:)) method, targeting the invisible agent.

For more information, see [GameplayKit Programming Guide](https://developer.apple.com/library/archive/documentation/General/Conceptual/GameplayKit_Guide/index.html#//apple_ref/doc/uid/TP40015172).

---

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)