<!--
{
  "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/SKFieldNode/electricField()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKFieldNode(cm)electricField"
  },
  "title" : "electricField()"
}
-->

# electricField()

Creates a field node that applies an electrical force proportional to the electrical charge of physics bodies.

```
class func electricField() -> SKFieldNode
```

## Return Value

A new electric field node.

## Discussion

The force points toward the field node’s position and has a magnitude proportional to the field’s [`strength`](/documentation/SpriteKit/SKFieldNode/strength) property and the physics body’s [`charge`](/documentation/SpriteKit/SKPhysicsBody/charge) property. This field models the first part of the Lorentz equation:

*F = qE*

Where *F* equals force, *q* equals charge, and *E* equals electric field.

The [`falloff`](/documentation/SpriteKit/SKFieldNode/falloff) property of an electrical field node is set by default to `2`.

---

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)