Contents

timingFunction

A block SceneKit calls to determine the action’s animation timing.

Declaration

var timingFunction: SCNActionTimingFunction? { get set }

Discussion

The timingMode property determines the input to your block. You use this input to compute your custom timing function, whose output determines the animation timing. The following example provides quadratic animation timing for an action, simulating the effect of gravity on a falling object:

action.timingMode = SCNActionTimingModeLinear;
action.timingFunction = ^float(float time) {
    return 1.0 - time*time;
};

See Also

Adjusting an Action’s Animation Properties