Search Issue Tracker
Fixed in 4.5.X
Votes
2
Found in
4.3.3f1
Issue ID
590946
Regression
No
When loading an asset bundle that contains a SpriteRenderer, the sorting layer for the sprite renderer gets reset to default
To reproduce:
1. Open attach project
2. Open Test scene
3. Enter play mode
Expected result: The prefab is instantiated and looks same way as the one already in the scene
Actual result: The prefab's sprite renderers lose their sorting layer, so they look different
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
- [Dragon Crashers] Build fails in U6
- [Dragon Crashers] 4 Shader error messages on import
- [Dragon Crashers] Readme text is white on light grey
- Cursor stays in front of the first character when entering text in the TextMeshPro field
- Searching in Hierarchy causes unwanted component calls
Cuicui_Studios
Jul 29, 2015 14:55
I´m using Unity 5.1.2p1 and have the same problem. I set the Sorting Layers on Tags & Layers but the SpriteRenderer do not recognize them.
Asema_Khan
May 08, 2014 11:17
Here is the temp solution for this issue:
I have simply attached a script with all the game objects that have Sprite renderer attached with them, the script will simply take a public string which will contain the name of sorting layer and will assign it to the renderer in Awake(). Here is the code and it works well for me after downloading assets from bundle.
using UnityEngine;
using System.Collections;
public class SOA_ChangeSortingLayer : MonoBehaviour {
public string sortingLayerName;
// Use this for initialization
void Awake () {
SpriteRenderer myRenderer = this.gameObject.GetComponent<SpriteRenderer>();
if(myRenderer != null)
myRenderer.sortingLayerName = sortingLayerName;
}
}
Asema_Khan
May 08, 2014 10:15
Is this issue fixed in 4.3.4 release? If not, can you suggest some alternative solution for this problem?
TomasJ
Mar 26, 2014 10:48
Will be fixed in next release.
benhumphreys
Mar 06, 2014 00:55
I see this issue also.