I got the colors to change back on collision exit, too!

gif_animation_001

For people having trouble with that, here’s what I ended up with for the object collision scripts.

    Color wallBrown = new Color(55f/255f, 31f/255f, 0f);
    private void OnCollisionEnter(Collision other)
    {
        GetComponent<MeshRenderer>().material.color = Color.red;
    }
    private void OnCollisionExit(Collision other)
    {
        GetComponent<MeshRenderer>().material.color = wallBrown;
    }
2 Likes

Fantastic job with your code :smiley:

Privacy & Terms