- Home /
(Answered)Objects Spawning In Pink?
If I drag the prefab in via the inspector it's normal black but when it's instantiated in it's pink. I'm using the default material and the only piece of script concerning colour/materials is this
renderer.material.color = Color(Random.Range(0.0,1.0),Random.Range(0.0,1.0), Random.Range(0.0,1.0));
I don't have anything else (variables, other lines of code etc.) which have anything to do with materials.
I've looked around but haven't found any answers.
Any help?
Thanks in advance
pink usually means it got no material at all. hit play button and pause after spawning the pink object, select it and make sure it has a material assigned to it. hope this will give you some clues, i don't know what's going on there.
@taxvi Worked it out. Changed it to gameObject.renderer.material etc. and did some other stuff. Not sure what made it work but it's fixed now
Your answer