<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKFieldForceEvaluator",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:@T@SKFieldForceEvaluator"
  },
  "title" : "SKFieldForceEvaluator"
}
-->

# SKFieldForceEvaluator

The definition for a custom block that processes a single physics body’s interaction with the field.

```
typealias SKFieldForceEvaluator = (vector_float3, vector_float3, Float, Float, TimeInterval) -> vector_float3
```

## Discussion

The block parameters are defined as follows:

- position: The position of the physics body. The coordinates are assumed to be in the following order: `x`, `y`, `z`. In SpriteKit, the `z` coordinate is always `0`.
- velocity: The velocity of the physics body. The coordinates are assumed to be in the following order: `dx`, `dy`, `dz`. In SpriteKit, the `dz` coordinate is always `0`.
- mass: The mass of the physics body.
- charge: The charge of the physics body.
- time: The amount of time that has passed since the last time the simulation was executed.

Your block should perform any force calculations you are interested in and return the resulting force.

> Important:
> Although your app can use the z coordinate of any of the float vectors to perform its calculations, the z value of the output vector is ignored by SpriteKit. Essentially, this means that you can use field effects only to animate a node’s ``doc://com.apple.spritekit/documentation/SpriteKit/SKNode/position`` property, not its ``doc://com.apple.spritekit/documentation/SpriteKit/SKNode/zPosition`` property.

---

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)