Contents

strength(by:duration:)

Creates an action that animates a change of a physics field’s strength to a value relative to the existing value.

Declaration

class func strength(by strength: Float, duration: TimeInterval) -> SKAction

Parameters

  • strength:

    The value to add to the field.

  • duration:

    The duration of the animation.

Return Value

A new action object.

Discussion

When the action executes, the field node’s strength 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