Question by
klskl · Sep 01, 2017 at 12:55 PM ·
gameobjecttexture2dtextures
creating a 2d rectangle and applying a texture to it
I want to create a colored rectangle, my normal approach would be to create a sprite of a rectangle in the desired size, import it to unity, attach it to a game object, then attach things like physics, collision control and what not.
However, I would like to create a rectangle of random size, then give it a texture. I can't do it the old way, cause then I would have to create several thousands sprites then take a random one.
How can I create a 2d rectangle, of random size, without using any sprite?
Honestly, I don't know if this question makes sense, I might be thinking of it all wrong, I just need to know what approach I should use, I am completely at a loss here.
Comment