electricField()
Creates a field node that applies an electrical force proportional to the electrical charge of physics bodies.
Declaration
class func electricField() -> SKFieldNodeReturn 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 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.