Search Unity

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

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

  1. NickCikovic

    NickCikovic

    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,637
    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.