Code for drawing multiple objects on GUI (3d)

Can’t believe I can’t find an example for this, maybe I’m not meant to do it.

I can find loads of tutorials on how to create UIs. Most are pretty good.

But say my character is holding 10 apples, and I want to draw 10 little apples (images) on the canvas, how can I do this? I don’t wan to create 10 objects on the canvas and turn them on and off, I can already do this.

So where should the code go to manually and dynamically draw/move images etc? And is there an small example anywhere?

Many thanks.

Create a prefab for a single apple and Instantiate as many apples as you need. You can use layout groups e.g. Horizontal Layout Group to automatically arrange them as they are created.