Reputation: 45
This code below works just fine in the editor / windows but does not work in Android build. Sprite change does not occur. Any reasons why?
spr = Resources.Load<Sprite>("Sprites/Projectile");
GetComponent<SpriteRenderer>().sprite = spr;
Upvotes: 1
Views: 2048
Reputation: 45
Alright I solved it. It has nothing to do with the Resources.Load function. Turns out the buttons were calling an inactive instance instead of the right instance of the object that contains the sprite change function.
Upvotes: 1