private void StopMoving(GameObject self) { MoveDirection moveDirection = self.GetComponent <MoveDirection>(); moveDirection.Bounce(); if (moveDirection.NumBounces >= moveDirection.MaxBounces) { //moveDirection.enabled = false; } }