A vector that specifies the gravitational acceleration applied to physics bodies in the physics world.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
Framework
- Sprite
Kit
Declaration
@property(nonatomic) CGVector gravity;
Discussion
The components of this property are measured in meters per second. The default value is (0
, which represent’s Earth’s gravity.