Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Sprite or Image that randomly appears

Discussion in '2D' started by Bloodjoker666, Mar 16, 2023.

  1. Bloodjoker666

    Bloodjoker666

    Joined:
    Nov 26, 2020
    Posts:
    42
    Hi,
    I don't know how to describe the bug:
    a Sprite/Image of a random item of my sprites folder appears in the middle of the screen, both in workspace and preview.

    The Sprite/Image is not listed in the hierarchy so I cannot see how to get rid of it !

    If I destroy the said Sprite/Image in my folder, it disappears, but if I rename a sprite with the same name it reappears.

    First, it was with one Sprite/Image, now I have two at once that polluate my view.

    Any idea of how to resolve that bug?

    Thanks!
     
  2. DavidTeo

    DavidTeo

    Unity Technologies

    Joined:
    Apr 1, 2021
    Posts:
    69
    Hello! That sounds pretty worriesome, will you be able to post a screenshot on the bug at the editor to allow us to understand better on the issue?

    Or even better, able to file a bug report with as much information as possible, and we can do some investigation
     
  3. Bloodjoker666

    Bloodjoker666

    Joined:
    Nov 26, 2020
    Posts:
    42
    A simple restart of Unity worked, but it's still the first time I expreriment that issue.

    I don't know how to post picture here but we can imagine: a random sprite/image that stick at position 0,0,0 without any reference in hierarchy...
    No bug reported from the console.

    I must precise that I work in 2D from the template of Unity 3D URP.

    I'm sorry I can't elaborate more: english is not my langage, and i'm a beginner.

    Thanks.
     
  4. Bloodjoker666

    Bloodjoker666

    Joined:
    Nov 26, 2020
    Posts:
    42
    Hi,
    I was able to recreate the bug, here's the steps:
    1- I create a Prefab;
    2- I open it;
    3- The image of the preview in the prefab-preview-panel is still there when I come back in my workspace panel or game preview panel.
    So, the bug seems to be from the prefabe preview panel that don't earase the image.

    Thanks.
     
  5. DavidTeo

    DavidTeo

    Unity Technologies

    Joined:
    Apr 1, 2021
    Posts:
    69
    Hello @Bloodjoker666 ,

    Thanks for the reply even tho English isn't your native language!

    I've tried briefly on your stated repro and I'm not able to repro it, and will need more information to narrow it down

    1 - What Unity version build are you using?
    2 - What packages have you installed? Notably 2d-related, since I noticed you mentioned about initially starting with 3D URP template and working with 2D
    3 - What kind of components and sprite do you have in the prefab?
    4 - Are you able to provide a screenshot (or a video repro, that will be a huge help) to show the issue?
     
  6. Bloodjoker666

    Bloodjoker666

    Joined:
    Nov 26, 2020
    Posts:
    42
    Hi,
    1- Unity 2020.3:21f1
    2- all 3DURP + 2D and video recorder
    3- Gameobject, like a bullet with Rigidbody2D, collider, spriterenderer, and a moving script
    4- not much, since the glitch disappear after reopening Unity.

    The glitch seems to come when I leave the prefab view-panel -> the image of the prefab stay in the middle of the Scene view and Game view... Reloading Unity solve that problem.

    Thanks.
     
  7. gdoggcasey

    gdoggcasey

    Joined:
    Sep 29, 2021
    Posts:
    2
    I just experience this exact bug and it nearly made me lose my mind. Just towards the end of our project and I updated the player prefab animations for some polish and all of a sudden the player sprite is just stuck in the center on all scenes and I had no idea why. Thank God closing and reopening unity fixed it because I was about to delete the entire project and just give up. What a silly bug.
     
    Bloodjoker666 likes this.
  8. DavidTeo

    DavidTeo

    Unity Technologies

    Joined:
    Apr 1, 2021
    Posts:
    69
    I'm sorry that happened to you as well @gdoggcasey ! If you are able to have a reliable reproduction steps and set up, please share them so we are able to quickly fix this issue
     
  9. Kyloman

    Kyloman

    Joined:
    Jul 15, 2018
    Posts:
    12
    Happened to me too. It is definitely something to do with editing a prefab. I got a weird error before this bug happened, it happened when I tried to create a C# script in my prefab when I had unrelated errors in other scripts already.

    It gave an error of something like "Error: tried to attach a script without MonoBehavior." After I fixed the unrelated compiler errors in my other script, I tried to save it and got another Debug.LogError about something like "Destination scene does not exist."

    Restarting the editor worked for me too.

    Version: 2021.3.15f1
    2D URP Project

    Sorry I couldn't help more, happened a couple hours ago and I can't reproduce it now.