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

Scene Management

-

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

  1. Resolution Note (5.6.0f3):

    The behaviour of returning null on Resources.LoadAsync("") is as intended.

Comments (2)

  1. 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.

  2. 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

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.