Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

GraphMotion.Play

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void Play(NodeReference node, float animationSpeed);

Parameters

Parameter Description
node The node on which to play the animation.
animationSpeed Speed multiplier for the animation. Higher values move the animated segment faster. The default value is 1.

Description

Starts a looping animation on the referenced node's accent.

The animation loops indefinitely until you call GraphMotion.Stop or GraphMotion.Pause. While the animation plays, the accent bar overrides any fill amount previously set through NodeReference.FillAmount or the node model's FillAmount property. Call GraphMotion.Play again on the same node after GraphMotion.Pause to resume the animation at the new speed.

 NodeReference nodeRef = context.GetNodeReference(nodeID);
 context.Motion.Play(nodeRef);