change the alpha of a gameobject with multiple childs

Helloo There!
I’m trying to change the alpha of a gameobject with multiple child objects, but I would like to know what I am doing wrong.
btw the childs have all different mesh renderes.
this is what I have:

`using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FadeHouse : MonoBehaviour

void OnTriggerEnter( Collider other)
   if(other.tag == "Player")
        foreach (Renderer r in allChildRenderers)
            Color c = r.material.color;
            c.a = 0.5f;
            r.material.color = c;


oh and I’m getting this error:
FadeHouse.cs(13,29): error CS1002: ; expected

Color is not reference type but value type,so even if you modify var “c” ,but it would not have change with material.

You should change like this:

        var mat = GetComponent<MeshRenderer>().material;
        var originCol = mat.color;
        var color = new Color(originCol.r, originCol.g, originCol.b);
        color.a = 0.5f;
        mat.color = color;