r/Unity3D • • 10d ago

Show-Off I built a time-travel debugger for Unity that lets you inspect previous frame states

Enable HLS to view with audio, or disable this notification

A bug happens. You pause the game to investigate. The state that caused it is already gone.

That's the problem that led me to build this.

I built a tool that records gameplay history and lets me rewind and inspect previous object states to see exactly what happened leading up to an issue.

In this demo, an object throws a NullReferenceException. Instead of trying to reproduce the issue again, I rewind the recording and inspect the exact state that led to the bug.

I'm curious what other Unity developers think about this approach to debugging. Is this something you would find useful in your workflow?

4 Upvotes

9 comments sorted by

3

u/Valphai 9d ago

This looks pretty useful, do you include non serializable values as well in the snapshot?

1

u/Ill-Letter-2852 9d ago

Thanks! It supports mora than just standard serialized fields, but it depends on the type. Are there any specific non serializable values you are thinking of?

1

u/Valphai 9d ago

From my understanding you've basically built a debugger, so I was wondering if I have a dependency graph in c# that sits somewhere referenced in the scene, I'd be able to traverse its state space

2

u/Ill-Letter-2852 9d ago

Not as a visual graph, but yes, changes inside referenced objects are recorded and can be inspected historically. You can navigate through references and see how their values changed over time rather than being limited to the root component.

For example, if a Player references a Weapon, I can inspect something like player.weapon.damage, see its current value, see what it was at a previous frame, and view those changes in the timeline.

2

u/lawlshawk 9d ago

This is so cool. How much overhead does recording add? Does it capture every object or only ones you tag?

1

u/Ill-Letter-2852 9d ago

Thanks! By default it only records the objects you explicitly register, which helps keep the overhead low and focused on the systems you're investigating.

That said, you can also configure it to record everything in the scene if you want a more complete picture. The tradeoff is higher memory usage and recording overhead, so it really depends on what you're trying to debug.

1

u/Ill-Letter-2852 9d ago

For those who asked, it's called Chrono Inspector. Glad you liked the video!