- Home /
PlayableDirector.Pause() weird behavior
Hi. I'm using WaitForSeconds() to wait before pausing a timeline with PlayableDirector.Pause(). The problem is that even though the timeline current time is RIGHT after pausing, visually the model animation is WRONG, it resets to the start of the animation clip when the door is not rotating.
I'm missing something?
This happens in 2017.3.1f1 and 2018.2.0b1 as well;
using System.Collections;
using UnityEngine;
using UnityEngine.Playables;
public class Playa : MonoBehaviour {
public GameObject ModelTarget;
void Start () {
StartCoroutine(WaitFunction());
}
// Update is called once per frame
void Update () {
}
IEnumerator WaitFunction() {
PlayableDirector director = ModelTarget.GetComponent<PlayableDirector>();
yield return new WaitForSeconds(8);
director.time = 8f;
director.Pause();
}
}
Answer by brunoricardo3d · Apr 24, 2018 at 04:28 AM
Managed to make it work using: PlayableDirector.playableGraph.GetRootPlayable(0).Pause();
.SetSpeed(0) will work too as pointed in: https://forum.unity.com/threads/pausing-director-from-playablebehaviour-will-not-allow-resume.526109/
Guess theres a lot I need to learn about unity's timeline.
Your answer
Follow this Question
Related Questions
Animation error (Last time I'm asking) 2 Answers
Instruct an animation to jump to specific point in timeline 1 Answer
Timeline not play animation when evaluate calling manually from script 1 Answer
How can I slow down to stop(HumanoidIdle) character when getting close to a object using timeline ? 0 Answers