---
title: electricField()
framework: spritekit
role: symbol
role_heading: Type Method
path: spritekit/skfieldnode/electricfield()
---

# electricField()

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

## Declaration

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

## Return Value

Return Value A new electric field node.

## Discussion

Discussion The force points toward the field node’s position and has a magnitude proportional to the field’s strength property and the physics body’s 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 property of an electrical field node is set by default to 2.

## See Also

### Creating Field Nodes

- [dragField()](spritekit/skfieldnode/dragfield().md)
- [linearGravityField(withVector:)](spritekit/skfieldnode/lineargravityfield(withvector:).md)
- [magneticField()](spritekit/skfieldnode/magneticfield().md)
- [noiseField(withSmoothness:animationSpeed:)](spritekit/skfieldnode/noisefield(withsmoothness:animationspeed:).md)
- [radialGravityField()](spritekit/skfieldnode/radialgravityfield().md)
- [springField()](spritekit/skfieldnode/springfield().md)
- [turbulenceField(withSmoothness:animationSpeed:)](spritekit/skfieldnode/turbulencefield(withsmoothness:animationspeed:).md)
- [velocityField(with:)](spritekit/skfieldnode/velocityfield(with:).md)
- [velocityField(withVector:)](spritekit/skfieldnode/velocityfield(withvector:).md)
- [vortexField()](spritekit/skfieldnode/vortexfield().md)
- [customField(evaluationBlock:)](spritekit/skfieldnode/customfield(evaluationblock:).md)
- [SKFieldForceEvaluator](spritekit/skfieldforceevaluator.md)
