playableGraph stop working
Hey,
I have a weird issue with playableGraph. I have a monobehaviour script that control a playable graph, i use the graph to animate characters. i have 2 nodes: one node with an animator controller and the other where i play oneshot animation clips. I have a really weird issue that i cannot understand: on mobile (iOS and android), if i exit the game and come back, the playable graph simply doesnt work. it' s like if the character are frozen. even if i spawn new characters, the playables are frozen. after 5-10 seconds, it starts working again. I really dont think that it is a bug on my side, it looks like an inside bug in the playable graph (since even for new characters spawned, it doesnt work)
Anyone can help? Thanks
Here is part of the relevant code...
void InitGraph()
{
// Creates the graph, the mixer and binds them to the Animator.
playableGraph = PlayableGraph.Create();
var playableOutput = AnimationPlayableOutput.Create(playableGraph, "Animation", GetComponent<Animator>());
mixerPlayable = Animation$$anonymous$$ixerPlayable.Create(playableGraph, 2);
playableOutput.SetSourcePlayable(mixerPlayable);
var clipPlayable = AnimationClipPlayable.Create(playableGraph, null);
var ctrlPlayable = AnimatorControllerPlayable.Create(playableGraph, Controller);
playableGraph.Connect(ctrlPlayable, 0, mixerPlayable, 0);
playableGraph.Connect(clipPlayable, 0, mixerPlayable, 1);
GraphVisualizerClient.Show(playableGraph, "$$anonymous$$y playable graph");
play$$anonymous$$ode = Play$$anonymous$$ode.AnimatorController;
playableGraph.Play();
}
Answer by seant_unity · Sep 07, 2017 at 12:18 PM
Try setting the time update mode of the playable graph to GameTime. That will handle the pause more gracefully than the default mode.