Search Unity

UI Image: set sprite to be gameObject-with-children-sprites?

Discussion in 'UGUI & TextMesh Pro' started by Avalin, Mar 26, 2019.

  1. Avalin

    Avalin

    Joined:
    Oct 12, 2018
    Posts:
    98
    Hi

    I have a gameObject in my scene which I had to divide into multiple ones with different parts of a sprite, so I have the head of the sprite in the parent, and lower body as a child. When clicking this gameobject I want to show a UI image of the gameobject in its entirety. Problem is that I can seemingly only set my UI Image sprite to be a singular sprite. Is there a smart way to go around this and merge a single sprite from my gameobject with children to my UI Image, or would it make more sense to just add a new sprite with the sprite I want sampled together?

    Also the GameObject has two different "states" that changes over the course of my game, one of which all sprite parts are glowing. Would be cool if I could somehow make the UI illustrate this. (The script I'm using is a general template for most of my objects that only have a single gameobject-sprite, so I want to make a solution with respect to that obstacle too)
     
    Last edited: Mar 27, 2019