Search Issue Tracker
By Design
Votes
0
Found in
5.5.0f3
Issue ID
858737
Regression
No
Resource.LoadAsync("") doesn't load all GameObjects from the Resource folder
Reproduction steps:
1. Open my attached project
2. Open the "scene" scene
3. Enter Play mode
Expected: under GameObject -> "Script" component all GameObjects residing in the resource folder should be listed.
Actual: Console throws a null reference exception
Note, if you open up the "Script" and change Resource.LoadAsync("") to Resource.LoadAsync("Cube"), it will add that GameObject to the list.
Reproducible on: 5.3.7p1, 5.4.3p3, 5.5.0f3, 5.6.0a6
-
NuShrike
Aug 27, 2022 16:07
This is still happening in Unity 2021.3.3f1. Resources.LoadAsync<T>("") always returns null even though there are assets in the Resources directory that has the object-type being sought.
Meanwhile, giving a non-null path such as the specific asset file's name, then properly returns the object-type sought.
-
Ladace
Dec 29, 2019 03:15
And the latest doc still claims if you pass a "" parameter you load everything in Resources folder. https://docs.unity3d.com/ScriptReference/Resources.LoadAsync.html
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
- [RenderingDebugger][InputSystemPackage] Ctrl+Backspace shortcut doesn't work to open the Rendering Debugger when New Input System is in use
- No option to skip video transcoding when launching a Project
- “ValidateSchema Error2” error is thrown in the Player when using IL2CPP Scripting Backend
Resolution Note (5.6.0f3):
The behaviour of returning null on Resources.LoadAsync("") is as intended.