I'm changing the draw order of some sprites in code and through the editor but nothing seems to happen.
In code, I add sprites onto a GameObject I have on the scene.
sprite = (GameObject)Instantiate(spritePrefab);
sprite.transform.parent = this.transform;
sprite.transform.position = new Vector3(160, 240, -1.0f);
sprite.transform.localScale = new Vector3(1,1,0);
sprite2 = (GameObject)Instantiate(spritePrefab2);
sprite2.transform.parent = this.transform;
sprite2.transform.position = new Vector3(160, 240, -2.0f);
sprite2.transform.localScale = new Vector3(1,1,0);
However, when I run it, I notice the sprites have a z of 0 and changing the z in both editor and code does nothing. Changing x,y works fine so I know the sprites are hooked in correctly.
Any help would be appreciated.
Thanks.