Search Unity

[SOLVED] Load a simple AnimationClipPlayable

Discussion in 'Scripting' started by HRV-Simulation, Jul 27, 2017.

  1. HRV-Simulation

    HRV-Simulation

    Joined:
    Oct 27, 2016
    Posts:
    6
    Hello,
    I would like to know how can I use the new Playable API to load an AnimationClip at RunTime by script within an Animator.

    I tried this so far :
    Code (csharp):
    1.  
    2. PlayableGraph playableGraph = animator.playableGraph;
    3. //clip variable is an AnimationClip
    4. playable = AnimationClipPlayable.Create(playableGraph, clip);
    5. animator.playableGraph.Play();
    6.  
    This code give me "Assertion failed" errors that say :
    "In order to call GetTransformInfoExpectUpToDate, RendererUpdateManager.UpdateAll must be called first."

    So what is the good way to load dynamically these AnimationClipPlayable (using Unity 2017.1.0f3).
    Thanks for your help.
     
  2. HRV-Simulation

    HRV-Simulation

    Joined:
    Oct 27, 2016
    Posts:
    6