How to check if Timeline Editor is scrubbing.

I have a need to know when the user is dragging the time on a timeline in editor play mode, because for the animation to display as intended there are some changes that need to be made in the scene (Disable Gravity/Collider/NavMeshAgent).

I am able to check for the Scrub Manipulator in the editor window state with reflection. Is there an easier/cleaner/intended way and if not is it something that could be considered to add in the future?

Hmm… typically this is passed to custom playables, but to query that externally…the closest I can think of is something like:

// the instance is active, but not playing and the time has changed
var playableDirector = TimelineEditor.inspectedDirector;
var isScrub = playableDirector.playableGraph.IsValid() && !playableDirector.playableGraph.IsPlaying() && lastTime != playableDirector.time;
lastTime = playableDirector.time;
1 Like