Getting Object Collided With

Hi, I’m having trouble getting the color of the object the player collided with. Any help would be greatly appreciated. C#

Well assuming you’re going from OnCollisionEnter(Collision collision), that’s just be:

void OnCollisionEnter(Collision collision) // that's the info on the collision that's occurred
{
collision.gameObject.GetComponent<Material>(). // Whatever colour is
}

Something like that, I think.

1 Like

Thank you for the response, it worked! I was trying to do stuff way more complicated than that.