Version: 2022.3
LanguageEnglish
  • C#
Method group is Obsolete

AnimationPlayableUtilities.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

Obsolete This function is no longer used as it overrides the Time Update Mode of the Playable Graph. Refer to the documentation for an example of an equivalent function.

Declaration

public static void Play(Animator animator, Playables.Playable playable, Playables.PlayableGraph graph);

Parameters

animator Target Animator.
playable The Playable that will be played.
graph The Graph that owns the Playable.

Description

Plays the Playable on the given Animator.

Note: This method is deprecated as it overrides the Time Update Mode of the Playable Graph. For an equivalent function, refer to the example below.

using UnityEngine;
using UnityEngine.Animations;
using UnityEngine.Playables;

public class Example { void Play(Animator animator, Playable playable, PlayableGraph graph) { AnimationPlayableOutput playableOutput = AnimationPlayableOutput.Create(graph, "AnimationClip", animator); playableOutput.SetSourcePlayable(playable, 0); graph.SetTimeUpdateMode(DirectorUpdateMode.GameTime); graph.Play(); } }