A node that applies physics effects to nearby nodes.
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
There are many different kinds of field nodes that can be created, each with different effects. The Creating Field Nodes section lists the field types you can create using SpriteKit, including a type that allows you to apply custom forces to physics bodies. Instantiate the appropriate kind of field node and then add it to the scene’s node tree.
When the scene simulates physics effects, a field node applies its effect to a physics body so long as the following are true:
The field node is in the scene’s node tree.
The field node’s
The physics body is attached to a node that is in the scene’s node tree.
The physics body is located inside the field node’s region (see
The physics body is not located inside the region of another field node whose
isproperty is set to