- Home /
Question by
red_fox_boy · Jan 11, 2020 at 10:37 AM ·
c#2dprefabsprefab-instance
Not sure how to change color of individual prefab instance after it was touched
Hello, I started making a 2d game, where an Individual Prefab Instance has to change color after being touched. I'm new to programming in C# and I've scoured the internet for hours but I still can't find an answer which works. I tried adding GetComponent<Renderer>().material.color = Color.red;
to the script on my prefab but it changes the color of all instantiated prefabs. My Unity version is 2019.2.3f1. Please help me.
Comment