Search Issue Tracker
Fixed in 5.4.0
Votes
0
Found in
5.2.2f1
Issue ID
743704
Regression
No
[AssetBundles] LoadAsset<GameObject>(name) returns null if a bundle contains a prefab and another asset with the same name
Reproduction steps:
1. Open attached project "PrefabNotLoaded"
2. Open scene "Demo"
3. Enter play mode
4. Observe the Console Window
--- You should see that LoadAsset<GameObject> (assetname) returns null
Asset bundle in question contains
Assets:
- Assets/Cube.prefab
- Assets/Cube.mat
Calling LoadAsset<GameObject> ("Cube") returns null
Workaround:
Use LoadAsset("Cube.prefab") instead of LoadAsset<GameObject> ("Cube")
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 block_locate_free when rendering a specific scene
- A submenu disappears on MacOS when the MenuItem method argument "isVariableFunction" is set to "false" and priority argument is set to "-1"
- The Sprite Library Editor window has an incorrect order of Sprites when the Sprites are reordered and the order saved
- Tilemap Tiles do not get lit up unless the Light Range is greater than the distance between the position of the Tile before the transformation and the Light Source when the Tile is transformed with Tilemap.SetTransformMatrix method
- The Editor and "Reloading Domain" windows are frozen when entering Play Mode
Font8
May 12, 2017 20:44
I got the same junk in 5.6p4. I can load my assets fine with just the name - no file extension - unless it's a .prefab, which seems to be treated specially for no good reason
ddelorme
Feb 20, 2017 18:50
I'm using unity 5.5.0f3 and I'm having this same issue. It's wasn't until I found this post that suggested I add .prefab to the end of my asset call that it fixed my issue. Maybe this is the new way Unity is handling loading asset bundles?
HarryCodder
Jan 29, 2016 14:24
It would be nice to see this backported to the 5.3.x branch also.
frank28
Dec 29, 2015 09:18
Hi,
Glad to see this bug is fixed. So in which version of Unity we could get this fix?