I keep getting a NullReference using Timeline. Please help

Hello,

I’m trying to animate the enemy waves using Timeline, however I keep getting a NullReference Error. I’ve watched Rick closely, and I’m certain I’m doing the same things as him, but the error prevents me from recording.

Here’s an image of my screen when I lock the timeline & select the enemy I wish to animate (bug(0)):

The error I get in the console when I try to click the record button is as follows:
“NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorWindow.RefreshStylesAfterExternalEvent () (at C:/buildslave/unity/build/Editor/Mono/EditorWindow.cs:1055)”

I managed to animate the Player Rig fine, but I’m stuck now. The NullReference is particularly strange because wouldn’t the instance of the enemy be the object I’m referencing?

Any help would be greatly appreciated.

Thanks!

1 Like

Hi Dale,

If you cannot figure out to what the NullReferenceException is referring, try to restart Unity. If that does not help, reinstall Unity. Since the message is referring to a Unity class, it might well be that it is an internal problem.

Which version of Unity do you use?

3 Likes

Hi Nina,

Thank you so much for your help! I restarted Unity as you recommended & it does indeed work! Thank you! Just so I know for future reference, is it typical that a NullReference Error which refers to a class could likely be a bug that can be solved with a restart?

Also, how were you able to identify that the message was referring to a Unity class? (My guess is that the “EditorWindow.cs” might be the clue?)

I recently updated to the newest Version of Unity :slight_smile:

Thank you so much once again! :slight_smile:

It depends on to which class the error message refers. If it is your class, it is in most cases a problem caused by you. For instance, you forgot to assign an object to an exposed field in the Inspector, or you are looking for an object that got destroyed, etc.

If the message refers to something else like, for example, EditorWindow, it is very likely an internal problem in Unity. That happens from time to time.

3 Likes

Ah, I see! Thank you! Sometimes the error messages in the console can be a bit confusing, so having little clues like that can be really helpful! Thanks :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms