- Home /
How to change only 1 game object
I've created some grounds to my level, however when i change tileset of one of them, all others change the tileset. how can i just modify each ground with a different number of tileset ? remembering that those grounds aren't children of other gameobject Sorry for the noob question guys.
Grounds? Please elaborate...
And if you are talking about the Tiling property under materials, then obviously it will affect the other GameObjects as well (on which the same material has been applied to). So if you don't want that then assign different material to your different GameObjects.
R u Generating those grounds? or those are prefix I mean u put them? or code puts them? Because when u clone them. Its more easy to change them. I mean, there's lots of ways to solve this problem, u can find the position of this gameobject. u can find it with raycast or Collider hit stuff. Or like u said, with a ID number. Its very easy. Just give us some more details.
u can change names;
Gameobject.name = Gameobject.name+i.toString(); // i is our increment number
i++;
So should I overload my game with a lot of the same materials just to modify each game object without affecting anothers ? here's a screen of what is happening to who didnt understand. When i edit the property of tiling the others chao changes it too. I dont want this. Should i create a folder with a lot of the same materials ?
Answer by aditya · Apr 13, 2016 at 10:40 AM
Use different materials for different GROUNDS
coz changing tileset of grounds is not changing tileset of that ground but changing an attribute of a material which is shared by all of your GROUNDS
Thanks man. that's the point, when i alter the tiling of the material i used in the game objects all them modify it together. i dont know if its correct to use many "same materials", wouldn't it overload my scene view? @aditya
the overload will be so small that you can't even notice it while running the game, make two material with different names, different tile sets but with same texture and assign them to your desired GROUNDS
and everything will be fine