Search Unity

Why is my sprite going missing on runtime?

Discussion in '2D' started by AV_Corey, Aug 4, 2016.

  1. AV_Corey

    AV_Corey

    Joined:
    Jan 7, 2016
    Posts:
    122
    I don't know what information I need to provide because I don't know why at all this is happening but now some of my sprites go missing when I play the scene. They don't move layer or go invisible, the sprite renderer literally sets the 'Sprite' to 'Missing(sprite)' whenever I play the scene.

    What is going on? It's driving me F***ing mental.

    EDIT: Any sprite I replace my player sprite with still dissapears so it can't be the import settings of the sprite itself.

    EDIT2: I did rename some folders earlier, would this cause anything like this?
     
    Last edited: Aug 4, 2016
  2. AV_Corey

    AV_Corey

    Joined:
    Jan 7, 2016
    Posts:
    122
    I fixed the problem. I was being stupid. I don't want to talk about it. I'm going to go and cry now.
     
  3. Danman9914

    Danman9914

    Joined:
    Jul 14, 2015
    Posts:
    2
    I'm seeing a similar issue. Mind saying what was going on for you?
     
  4. prajit33

    prajit33

    Joined:
    Oct 18, 2018
    Posts:
    1
    i m facing the same issue. Does anyone know how to fix this?
     
  5. vakabaka

    vakabaka

    Joined:
    Jul 21, 2014
    Posts:
    1,153
    check the z-position from the sprite
     
  6. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    If your player and enemies are stored inside of an empty gameobject and set as a prefab, you must remember to set all empty objects to the same origin Transform position before inserting your player and enemies. Otherwise, your objects will teleport to the position of the parent object, which I suspect is an empty game object. I found this out because I had the same problem a few months ago. lol
     
  7. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    You can also find out when you click play, click on one of your missing objects and use CNTR+F to focus on it. That way if it's not the empty object causing the issue, you can do some detective work and find out what made it move to that position and fix it. Just remember to do all your fixes when the game is not running ;)
     
  8. alper2tr

    alper2tr

    Joined:
    Mar 15, 2019
    Posts:
    3
    Hello
    if you place 2 d game object , it may cause this problem.instead i use sprite instead game object and it never misses the sprite
     
  9. unity_wIa5KpJFey13oA

    unity_wIa5KpJFey13oA

    Joined:
    Aug 29, 2020
    Posts:
    1
    try setting your cam to -1 in transform position
     
  10. Bigmancozmo

    Bigmancozmo

    Joined:
    Sep 13, 2020
    Posts:
    17
    Check the Z position and/or the Order in Layer