<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKPhysicsWorld/sampleFields(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKPhysicsWorld(im)sampleFieldsAt:"
  },
  "title" : "sampleFields(at:)"
}
-->

# sampleFields(at:)

Samples all of the field nodes in the scene and returns the summation of their forces at that point.

```
func sampleFields(at position: vector_float3) -> vector_float3
```

## Parameters

`position`

A position in scene coordinates.

## Return Value

The summation of forces exerted on that point.

## Discussion

The sample is calculated as if a physics body is placed at that position in the scene. The body is assumed to have a mass of `1.0`, with no charge or velocity. The body is affected by all field nodes.

---

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)