Color changing stopped at all after adding the if statement

I added the if statement. The color changing stopped even when it was the Player colliding into any walls or obstacles. Why?

Hi,

Welcome to our community! :slight_smile:

Have you already tried to add Debug.Logs to your code to see what is going on during runtime? For example, what is the value of other.gameObject.tag? Maybe you do not get “Player” but something else.

I just added a Debug.Log to see if it’ll change anything. And magically it begins to work. Even after I deleted the line, it still works. Maybe it was a hidden power driving me toward the community. :grinning_face_with_smiling_eyes:

Maybe your script was not saved properly. See the white dot here:

image

If you see it and the script should have been saved, save the script again. :slight_smile:

That should be the problem. Thanks!

Welcome Ip300 :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms