after instantiating primitives in script… spheres, cubes etc…
how do I add various materials to them in script ?
…assuming I know the names of the materials allready… e.g. “MyMaterial”
thx
after instantiating primitives in script… spheres, cubes etc…
how do I add various materials to them in script ?
…assuming I know the names of the materials allready… e.g. “MyMaterial”
thx
You could use this for material assignment, but I wouldn’t advise relying on strings because they’re slow and messy. Any reason you actually need to do that, and can’t just use a reference to an actual material instead?
thanks, appreciated.
Yeah, trying to setup little handy scripts and prefabs, that don’t require setting after being dragged onto other game objects.
We have alot of issues (maybe because of incorrect use, or too many cooks working on one level) where settings and variables keep getting wiped out.
I think mainly due to us using SVN for version control.
maybe this will go away in time with practice… or maybe its just SVN, not sure yet.
thanks for help