Track cannot be loaded until I force a recompile

In Unity 2021.2.10 Every time I open Unity my custom track says it can’t be loaded. There are no errors or relevant warnings in the console. If I force a recompile of all scripts by making a dummy change in a script, such as adding a space character somewhere and switching back to Unity, then it suddenly works and my custom tracks appear… until the next time that I open Unity and need to make another dummy change in a script.

Ideas on how to fix it more permanently?

3 Likes

I am encountering the same bug in 2021.3.3f1.

Same here 2022.1.9f1

I am having the exact same issue, 2019.4.31f1

I’m not able to reproduce this bug; I’ll ask you to please open a bug report.

My Problem was that I was having two classes (TrackAsset and PlayableAsset) in one .cs file. I seperated them into two files and files having the same name as the class name. Problem gone.

That is correct. Classes that derive from ScriptableObject and Monobehaviour need to be in separate .cs files. This is a limitation of Unity’s serialization system. Since TrackAsset and PlayableAsset are also ScriptableObjects, they need to be located in separate files too.

I’m having the same issue in 2022.2.17f1. Even though the classes are in separate files.
If I make a dummy change in a script like atlas_r mentioned, then it works, until I restart unity.

[Fixed]
The issue occured with timeline tracks that were created when the classes were in the same file. However when I separated the classes into separate files, the problem still ocurred with the existing timeline tracks, but new timeline tracks were fine.
So I guess the old ones were saved in a broken state or something.

2 Likes