// if a watercooler flies over your head, win some bonus money fo' dat sicc stunt bool CheckForOverheadWater() { Vector3 up = new Vector3(0, 1, 0); Vector3 headPosition = playercontroller.transform.position + up * 1.3f; Ray ray = new Ray(headPosition, up); //Debug.DrawRay(headPosition, up * 10.0f); RaycastHit[] hits = Physics.RaycastAll(ray, 10.0f); foreach (RaycastHit hit in hits) { DynamicObstacle obstacle = hit.collider.gameObject.GetComponent <DynamicObstacle>(); if (obstacle != null && !obstacle.HasDoneMeanStunts()) { obstacle.DoMeanStunts(); return(true); } } return(false); }