- Home /
Unity Game View won't refresh my sprites
I am currently trying to make a 2D unity game, and the goal is to break blocks. To achieve this, the sprite uses a "hit point" system, then deletes it's self when it hits zero. BUT, for some odd reason, Unity keeps the sprite loaded in the game view. It is gone in my scene view, so I know it is working. It just won't disappear in my game view. I have tried searching for some sort of refresh for the SpriteRenderer component, but I can't seem to find anything.
private void Start()
{
if (depthMultiplier == 0)
{
hitPoints = 3;
}
}
void OnMouseDown()
{
hitPoints -= 1;
Debug.Log(hitPoints);
if (hitPoints == 0)
{
Destroy(gameObject);
}
}
}
Code I am currently using
Sprites won't go away in game view
Answer by HelpMeGame · Nov 16, 2019 at 12:54 AM
Ok, fixed my own problem. After messing around with the camera for a little while, I found the Clear Flags property. Apparently, I had just turned this off instead of changing the Skybox.
Your answer
Follow this Question
Related Questions
Translucent sprites appear solid 0 Answers
Setting a sprite's size with pixels 2 Answers
How to change spriterenderer to everyone with RPC 0 Answers
Unity2D Sprite Fading Issues 1 Answer
How to instance custom sprite shader? 0 Answers