How do I call a variable from other script components?
mirror.transform.position = cop.GetComponent(\"AI_Car\").mirrorPos;
It seems that th
You can cast it to the right type:
mirror.transform.position = ((AI_Car)cop.GetComponent("AI_Car")).mirrorPos;
mirror.transform.position = cop.GetComponent().mirrorPos;
Anyway, the best is to make an AI_Car property, then get it on start, so you can simply read it anywhere in the class by aiCar.mirrorPos or similar.