Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved My character suddenly disappears when I run the game

Discussion in 'Getting Started' started by OldManHighwind, Mar 8, 2021.

  1. OldManHighwind

    OldManHighwind

    Joined:
    Feb 21, 2020
    Posts:
    14
    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:
    Capture.PNG Unityerror.gif Capture.PNG
    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.
     
  2. OldManHighwind

    OldManHighwind

    Joined:
    Feb 21, 2020
    Posts:
    14
  3. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Your SpriteRenderer's Sprite property changes to "Missing" once you enter Play mode. Are you changing that value in code somewhere?
     
    OldManHighwind likes this.
  4. OldManHighwind

    OldManHighwind

    Joined:
    Feb 21, 2020
    Posts:
    14
    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.
     

    Attached Files:

  5. OldManHighwind

    OldManHighwind

    Joined:
    Feb 21, 2020
    Posts:
    14
  6. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    Please stop bumping your own thread.
     
  7. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    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.
     
  8. DTheChemist

    DTheChemist

    Joined:
    Jan 18, 2021
    Posts:
    115
    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
     

    Attached Files:

    Last edited: Mar 13, 2021
    whitegumby likes this.
  9. OldManHighwind

    OldManHighwind

    Joined:
    Feb 21, 2020
    Posts:
    14
    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.
     
    maximboyadjiev and Ferja16 like this.