How would I script a trigger that changes a game objects material to a new material (NOT Texture), when the trigger is entered by that player.

I have no clue how to do this and I’ve looked everywhere.

// player will trigger a material change
void OnTriggerEnter(Collider other) {
if (other.tag == “Player”) {

    // creates a new material instance that looks like the old material
    void ChangeMaterial() {
        Material originalMaterial = GetComponent<Renderer>().material;
        originalMaterial = new Material(originalMaterial);