Contents

changeMass(to:duration:)

Creates an action that changes the mass of a node’s physics body to a new value.

Declaration

class func changeMass(to v: Float, duration: TimeInterval) -> SKAction

Parameters

  • v:

    The new mass of the physics body.

  • duration:

    The duration of the animation.

Return Value

A new action object.

Discussion

When the action executes, the physics body’s mass property animates from its current value to its new value.

This action is not reversible.

See Also

Animating Properties of a Node’s Physics Body