Ever had an artist hand you a video and say "just recreate this in Unity"? Yeah, me too. Eyeballing animations is hell.

The Problem

You're comparing your Unity scene to a reference video by alt-tabbing between windows, constantly pausing, rewinding, and tweaking keyframes. Hours later, the timing still feels off because you're playing spot-the-difference with two moving targets.

The Solution

What if you could scrub through both the reference video and your Unity animation simultaneously? That's exactly what I built.

How It Works

The VideoScrubber tool does three things:

Here's the core scrubbing logic:

public void ScrubToProgress(float normalizedTime)
{
    if (!isVideoReady || videoDuration <= 0) return;
    
    normalizedTime = Mathf.Clamp01(normalizedTime);
    wasPlayingBeforeScrub = videoPlayer.isPlaying;
    videoPlayer.Pause();
    
    double targetTime = normalizedTime * videoDuration;
    videoPlayer.time = targetTime;
}

The key insight: pause before seeking, otherwise you get weird playback behavior.

The Update Loop

Two-way binding between the slider and video:

void Update()
{
    if (!isVideoReady) return;
    
    // Slider moved? Scrub video
    if (Mathf.Abs(progress - lastProgress) > 0.001f)
    {
        ScrubToProgress(progress);
        lastProgress = progress;
    }
    // Video playing? Update slider
    else if (videoPlayer.isPlaying)
    {
        progress = (float)(videoPlayer.time / videoDuration);
        lastProgress = progress;
    }
}

The Workflow

  1. Drop video into Unity
  2. Set up VideoScrubber component
  3. Create an Animation Clip that animates the progress field from 0 to 1
  4. Play your Unity animation - the video plays in perfect sync
  5. Match timing precisely by adjusting keyframes

What used to take hours now takes minutes. No more alt-tabbing or guessing.

Why This Matters

Small workflow improvements add up. Every hour saved on tedious animation matching is an hour spent on actual features. Sometimes the best solutions just wire existing tools together in the right way.

Next time an artist says "recreate this," you can smile instead of cry.