void OnTriggerEnter(Collider collider) { GameObject thingHit = collider.gameObject; // Ball enters playbox if (thingHit.GetComponent<Ball> ()) { ballEnteredBox = true; standingDisplay.color = Color.red; } }