Contents

affectedByGravity

A Boolean value that indicates whether this physics body is affected by the physics world’s gravity.

Declaration

var affectedByGravity: Bool { get set }

Discussion

The physics world’s gravity property defines the gravitational forces applied to volume-based bodies in the scene.

The default value is true. This property is ignored on edge-based bodies, which are always unaffected by gravity.

Physics bodies with affectedByGravity set to false are still affected by the gravity fields created by linearGravityField(withVector:) and radialGravityField().

See Also

Defining How Forces Affect a Physics Body