<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKPath/float2(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKPath(im)float2AtIndex:"
  },
  "title" : "float2(at:)"
}
-->

# float2(at:)

Returns the 2D point at the specified index in the path’s list of vertices.

```
func float2(at index: Int) -> vector_float2
```

## Parameters

`index`

The index of the vertex to return, between `0` and the [`numPoints`](/documentation/GameplayKit/GKPath/numPoints) value.

## Return Value

The vertex at the specified index.

## Discussion

You define a path’s vertices when creating it, either directly with the [`initWithFloat3Points:count:radius:cyclical:`](/documentation/GameplayKit/GKPath/initWithFloat3Points:count:radius:cyclical:) initializer or indirectly with the [`init(graphNodes:radius:)`](/documentation/GameplayKit/GKPath/init(graphNodes:radius:)) initializer.

If the path is a 3D path, this method is still functional but returns only 2D vectors, ignoring the z-component of each point on the path.

---

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)