- Home /
Question by
unity_NwjSBWdoDScpdQ · Jul 30, 2019 at 05:13 AM ·
spritecanvasui image
Dynamically setting gameobject sprites in UI Image
I want to load dynamically a gameobject sprite which has sprite body parts (head, body, legs) into a canvas UI Image. I only found recommendations to set the image sprite like this:
imageCanvas.sprite = sprite;
but because i have a hierarchy of sprites to render, is there an easier way than to recreate the hierarchy for every gameobject sprite?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612205723im_/https://answers.unity.com/themes/thub/images/avi.jpg)