- Home /
Editor Shared Material
I am making a simple tile map generator that generates a plane and a tilemap on it in the Editor. When I try to change the offset for different tiles, I have to use sharedMaterials or else there is a material leakage.
Is there a way to change the offset in the code without manually changing each tile by hand.
Thanks!!!
Answer by DaveA · Aug 22, 2012 at 10:19 PM
Sounds like each tile needs its own unique Material (which would share the same texture)
So your saying that I would have to offset each tile I want as a new material and then assign each plane to that tile?
For each tile, create new material, assign that one texture to it, offset each material accordingly. You might make a na$$anonymous$$g convention like $$anonymous$$at1_1 $$anonymous$$at1_2 etc. to tell them apart. BTW if you are just doing this to use one material across a bunch of objects, you might be interested in triplanar shaders like in Voxelform.
Your answer
Follow this Question
Related Questions
Pressing play Causes Re-instancing of material (Editor) 1 Answer
Enable Emission to update at run time in editor 5.6.1? 2 Answers
Changing the materials in Editor Mode Without Getting the leak Error 3 Answers
How can I interacte with Sprites from a Texture with Sprite Mode multi? 1 Answer
Tilemap focus problem 0 Answers