public BasePawn CastRay() { GameObject GO = PC.PointAtObject(100, transform, Test); if (GO != null) { BasePawn P = GO.GetComponentInParent <BasePawn>(); if (P != null) { return(P); } else { return(null); } } else { return(null); } }