# Why doesn't the prefab change in the app?

Such a problem: from the script, I change the image of the sprite of SpriteRenderer component (like another skin) in a certain prefab, having a link to SpriteRenderer. And the problem is that when I run the game in unity, everything works, i.e. the skin changes. And when I run it in the app (apk file), the skin doesn't change. Why is that?

[SerializeField] SpriteRenderer player; // in the inspector, I drag the player's prefab to this field
[SerializeField] Sprite[] skins; // here I drag the player's images (skins)
int i = Random.Range(0, skins.Length);
player.sprite = skins[i]; // this is how I assign the skin to the player

• When does this code run? Please try to give us enough setup instructions that we can reproduce this problem in a new empty project, so we can test potential solutions. – DMGregory May 18 at 11:01