Hey there. I’m pretty new to Unity but I am learning how to code now. The problem is the “OnTriggerEnter” function is not working. It doesn’t even change color. I got the code from a youtube tutorial so I know it works. Heres the part of the code.
I just ran into this problem as well. In Hierarchy view, I have a parent object with one child object with the same name. Looks like I inadvertently assigned the script handling the OnTriggerEnter event to the parent object, but the collider to the child object. Adding collider to the parent object fixed it. I’m still very new, but I am surprised that having an OnTriggerEnter event in a script attached to object without collider does not generate a compile error or warning message.