Search Issue Tracker

By Design

Votes

1

Found in

2017.4.0f1

2018.4.0f1

2019.1.14f1

2019.2.0a1

2019.3.0a1

2020.1.0a1

Issue ID

1186968

Regression

No

Asset will return null even if that Asset exists when calling Resources.Load, but only for the first time

Asset - Database

-

How to reproduce:
1. Open the attached project in editor.
2. Notice the error log "EditorInit could not get the TestScriptable asset" despite the fact that the asset is part of the project.
3. Close and reopen the project.
4. Notice the error log is not present anymore.
- optionally: close the project, delete the /Library folder, reopen the project, notice that the error log is back.

Reproducible with: 2017.4.32f1, 2018.4.10f1, 2019.2.7f2, 2019.3.0b5, 2020.1.0a6

Actual results: Assets return fake null for the first time
Expected results: if the Asset exists it shouldn't return null

  1. Resolution Note (2019.3.X):

    Non scripts can not reliably be loaded from InitializeOnLoad static constructors

Comments (1)

  1. mosowskitsg

    Aug 14, 2020 23:48

    I managed to reproduce this issue on 2020.1.2f1 with simple Resources.Load<GameObject>() call in Start method. Method fails until I do "something complex enough", i.e. change script and recompile or reimport specified prefab.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.