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

Getting Single Sprite from a spritesheet and add that in the Gameobject.

Discussion in '2D' started by cbothra, Apr 24, 2014.

  1. cbothra

    cbothra

    Joined:
    Mar 14, 2014
    Posts:
    125
    Hi community,

    Sorry if there is already an existing post for this query.

    I am new to unity 2d and ran into a problem. The problem is that I have a sprite sheet in my assets folder. Basically what I want to do is create a sprite gameobject at runtime and assign a single sprite from the spritesheet to it. Can anybody help me providing a solution for this issue.

    Thanks in advance.
     
  2. KesConcept

    KesConcept

    Joined:
    Dec 8, 2013
    Posts:
    9
    If I understand correctly you want to select the sprite sheet -> in Inspector click sprite mode > Multiple then hit Sprite editor > Slice > select size > apply > Then in your assets you'll see your sprite sheet now when you click the arrow has multiple sprites of which you can select any one of them and set it as your object's sprite renderer.

    - Kes
    http://KesConcept.com
     
  3. tdvance

    tdvance

    Joined:
    Nov 8, 2016
    Posts:
    4
    he said "runtime"