My character suddenly disappears when I run the game

As stated and seen in the attached gif whenever I run my game my character vanishes, I can still control the character and according to my animator the animations are playing but there’s nothing visible.

I’ve seen people saying to check the layers tab but everything is on, and my camera position hasn’t changed.

My animator and sprite renderer are stored on a child of my player called Visual.

Here’s a screenshot while the game is running of the visual object:

6911426--810098--Unityerror.gif
I was working on a particle system and the only changes to the project I made that I’m aware of are to that particle since the last time I ran the game and it was working.

Bump

Your SpriteRenderer’s Sprite property changes to “Missing” once you enter Play mode. Are you changing that value in code somewhere?

1 Like

I hadn’t noticed that, there’s nothing in my scripts that would remove the sprite set, I also tried adding one of the projectile prefabs directly in the scene and the same thing happens to that. I tried adding just a sprite to the scene and it worked but changed it entirely to black as seen in the attached gif.

6915089--810938--unityerror2.gif

bump

Please stop bumping your own thread.

Yeah, bumping a thread with no new information isn’t really a great idea around here. You can see from the main page that your thread has gotten a good many views, so if you’re not getting responses it’s because people don’t feel they have any information they can provide.

Instead of bumping, post any new information you’ve discovered since your last post. Try typing out your thoughts on what might be happening. Post what you’ve tried changing, relevant scripts that might be impacting things, etc. At the very least, someone might chime in stating how something you’ve suggested isn’t likely, or correct your thinking on something unrelated that might end up sparking a thought that leads you down the right path. In any case, showing that you’re still working at it will encourage others to assist you, rather than it seeming like you’re just posting your problem and waiting for someone else to figure it out for you.

If all else fails, consider that where you’re posting might not be the right subforum for your problem. This isn’t, after all, a “Getting Started” issue so much as it is an issue with the Sprite renderer, right? Maybe you’d have better luck posting in the 2D subforum.

This is the most helpful and active community I’ve ever been a part of, and if nobody’s helping you it’s generally because your issue is unique or obscure enough that most people haven’t experienced it. There’s also the possibility that the 3 large GIFs in your original post actually make it MORE difficult to determine what your issue is, since it feels a bit like doing a hidden object search / spot-the-difference kind of thing. Focusing on only providing relevant information is more likely to get you concise, helpful responses.

Did you look below your sprite renderer for the character? change the number of 1 to 5 in the order of layer. i see you have it at 1. i had that same issue when i first started and it fixed the issue. It either wouldnt show at all or he would flicker when he moved across the screen. putting it to 5 in my case made him appear and fixed it. so it could be that. Also be sure to fix that “Missing sprite” issue. hopefully that helps

1 Like

Sorry everyone for the hassle I’ll try and be more respectful of the other users on the site in future posts I was just getting frustrated.

I did eventually find out what the issue was for anyone else having the same problem that all of the other solutions such as order in layer and z position. All of my sprites had been set to Sprite Lit Default which is why they were black when added to the scene and I’d moved my animation files in my project so I needed to reassign them to my animator.

Again sorry for bumping the thread.

2 Likes