I’m wondering how to create on the fly a Cloth type Gameobject using C# code and then assign to it a texture, like I can do - for example - with primitives types:
tmp = GameObject.CreatePrimitive(PrimitiveType.Cube);
tmp.renderer.material.mainTexture = my_custom_ texture;
As a newbie I’m stuck with it and I can’t figure out how to do it. Is it possible?
Any help will be very appreciated.
Thanks in advance.