Search Unity

Evaluate PlayableGraph at runtime

Discussion in 'Animation' started by Felipeota, Feb 9, 2018.

  1. Felipeota

    Felipeota

    Joined:
    May 30, 2013
    Posts:
    7
    Can I call evaluate to a playableGraph with DirectorUpdateMode.Manual at runtime and have an animation play without using a playabledirector?
     
  2. Felipeota

    Felipeota

    Joined:
    May 30, 2013
    Posts:
    7
    I managed to get it running. Apparently you have to call Rebind on the Animator component every time you modify the graph to add new clips or something. After that you can call evaluate on the graph to update it and it will work.
     
  3. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    Generally it is not a good idea to add clips during runtime. Rebind searches child transofrms by names and this is very slow and costly function to call from update. It is better to construct your graphs and add all clips in Awake.