I’m having some trouble right now with my player sprite. I have a little shop inside my game where you can change the skin of the player, i’ve used a sprite changer script:
public class SpriteChanger : MonoBehaviour
{
SpriteRenderer spriteRenderer;
// Use this for initialization
void Start()
{
spriteRenderer = GetComponent<SpriteRenderer>();
}
public void change(Sprite differentSprite)
{
spriteRenderer.sprite = differentSprite;
}
}
It works fine inside the shop, but when i change from my Shop Scene to my Game Scene (i have a back to menu button, then a play button) It is not saved, even though I’m using the same player prefab on both the shop and the game scene. What do you think is the problem? I haven’t really seen any tutorial addressing this error.