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:
- Loads a reference video in Unity
- Lets you scrub frame-by-frame with a slider
- Overlays your Unity scene on top for direct comparison
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
- Drop video into Unity
- Set up VideoScrubber component
- Create an Animation Clip that animates the progress field from 0 to 1
- Play your Unity animation - the video plays in perfect sync
- 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.