changeMass(by:duration:)
Creates an action that changes the mass of a node’s physics body by a relative value.
Declaration
class func changeMass(by v: Float, duration: TimeInterval) -> SKActionParameters
- v:
The amount to add to the physics body’s mass.
- 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 reversible; the reverse is created as if the following code is executed:
See Also
Animating Properties of a Node’s Physics Body
applyForce(_:duration:)applyTorque(_:duration:)applyForce(_:at:duration:)applyImpulse(_:duration:)applyAngularImpulse(_:duration:)applyImpulse(_:at:duration:)applyImpulse(_:duration:)changeCharge(to:duration:)changeCharge(by:duration:)changeMass(to:duration:)strength(to:duration:)strength(by:duration:)falloff(to:duration:)falloff(by:duration:)