- Home /
Reusing material on multiple prefabs, issues with tiling
I have two prefabs for the ground in my 2D game. The first is a 1x1 cube, the second is 2x1. My texture is 1x1 and the same for both prefabs. I want to use the same material for both prefabs, however this means I want the texture to be clamped for the 1x1, and tiled (or repeated) twice for the 2x1 prefab.
I'm currently using two materials with the same image: one clamp, one repeat. I know that more materials means a slower game, so is there an easier way for me to handle this? I've tried assigning the TextureWrapMode and Tiling programmatically, but changing the material's properties on one prefab seems to change it for all prefabs with that same material.
TL;DR How can I get a single material to be tiled on one prefab and clamped on another?
Answer by Eric5h5 · Jul 19, 2013 at 01:58 AM
You can't have different tiling settings on the same material; tiling is a function of the material, so if you want two different tiling settings you need two different materials. You could however make your own 2X1 cube in a 3D app where you change the UVs of the mesh to tile the texture twice, that way you only need one material.
Your answer
Follow this Question
Related Questions
Prefab Material 0 Answers
Tiling textures in material without changing the material. 0 Answers
How do you properly let unity resize texture tiling? 0 Answers
Repeating a texture over an object 2 Answers
No material and prefab connections 1 Answer