Hello, and Happy New incoming Year!
// Story
I get an idea to create a “spiral stairs generator”. Since in my “game” should be many multi-leveled buildings, and I’d like to have nice architecture, spiral stairs are must. Normally I’d make a spiral stairs in Blender, set everything there and import into Unity. But, let’s say that I want different step length, so I have remade whole model. Using physics is also hard, since I don’t have acces to single step. Och, and changing amount of steps is also remaking whole model.
Having that in mind I wrote script, which can quite well generate it for me.
I’m making mesh from scratch of single step. Create multiple steps, then set their positions, and set steps as children of “mother-stairs”. Simple math.
// Question
However, there is going UV. I know, that UV is Vector2 with X,Y variables from range <0;1>, where values are percentage of width and height of texture (nice feature for different texture resolutons).
This is the effect of “hard set” for vertices.
Almost well.
In theory my Mesh (are), and its UVMap (should) look like this:
// TL;DR
As You can see in picture above, there are many occurences of one vertice in UVMap. Is there any way, to made proper UVMap without duplicates?
If it’s impossible, how to do duplicate it easily and properly?
Thank You in advance,
Drakonno


Just BTW unrelated to your question. When generating objects, sometimes it is better to K.I.S.S. I would consider making a routine which generates one GameObject being "one step unit", that is to say one riser + tread (plus carrier, nubs, or anything else). For example, say you are generating a room. It's often better to simply have four separate GameObject for the walls, rather than one GameObject. Apart from anything else, it's much easier to unit test, modify and so on. That's what I've found! Cheers PS http://www.tradestairs.com/acatalog/stair-terminology.GIF
– Fattie