- Home /
How to query the Animation Editor window's scrubber time?
Does anyone know how to query where the scrubber is in the Animation Editor window?
I am trying to find the value of the red scrubber to update content in my other custom editor window running in the same Unity editor.
Currently I have tried the following in my Editor window control, (m_mainAnimationObject points to the gameobject that has the animation I'm wanting to query the time for.)
m_animation = (Animation)m_mainAnimationObject.GetComponent("Animation");
if (m_animation != null)
{
foreach (AnimationState state in m_animation)
{
EditorGUILayout.LabelField("Time", state.time.ToString());
}
}
When I run the game this does indeed update as expected, but uses the time of the animation time running in the game, however just moving the red scrubber doesn't update this Time element so how else can it be done?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613065127im_/https://answers.unity.com/themes/thub/images/avi.jpg)