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

Sprite Not Instantiating

Discussion in 'Editor & General Support' started by Wittz8, Jan 27, 2020.

  1. Wittz8

    Wittz8

    Joined:
    Apr 2, 2014
    Posts:
    1
    Beginner here. I'm trying to instantiate a sprite. When I do it manually on the hierarchy I can see the sprite, but when drag and drop the prefab and run it the sprite doesn't appear. I don't get an error message -- it just doesn't happen.

    Code (CSharp):
    1. public Sprite redBall;
    2. private void Start() {
    3.             Instantiate(redBall, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity);
    4.         }

    Thank you for your time.
     
  2. knobblez

    knobblez

    Joined:
    Nov 26, 2017
    Posts:
    223
    Put it on a panel and under a canvas