private void OnObstacleDespawnTriggerEnterEvent(Collider col) { if (isActive) { ObstacleController obstacleController = col.GetComponentInParent <ObstacleController>(); if (obstacleController != null) { obstacleController.Despawn(); } } }