Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Imported Animated Sprite disappears when game is playing... HELP PLEASE.

Discussion in '2D' started by GameSnapXtreme, Feb 20, 2021.

  1. GameSnapXtreme

    GameSnapXtreme

    Joined:
    Aug 19, 2017
    Posts:
    28
    I am developing a 2D Platformer on top of the code used in 2D Game Kit (I am still very inexperienced with coding, as this is my first game). Whenever I tried importing sprites into this, they disappear upon the game starting. I'm only on the first imported sprite right now, and that's when I discovered this very problematic issue.

    For the record, I did try this in some other test projects aside from 2D Game Kit's source code; those projects have even simpler code that I typed myself. The same thing happens in those too.

    I tried debugging the game, found no significant errors in the code. I made the imported sprite the exact same size as the one the asset comes with, didn't work. I am truly stuck in a rut right now. Any help would be greatly appreciated here. Below is a picture of what I mean and a picture of the sizes it's supposed to be.
     

    Attached Files:

  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,543
    Hi,

    "Whenever I tried importing sprites into this, they disappear upon the game starting."

    Pretty hard to say based on information you provided. Maybe share some screen captures with useful information.

    Are you sure that sprite actually disappears?

    How does your hierarchy look before game is running and when game is running?

    How have you you setup your sprite renderer?

    Are you sure object isn't simply moving?

    If this happens in two different projects, maybe you've setup something incorrectly.
     
unityunity