// Fires when the player collides with any other collider void OnControllerColliderHit(ControllerColliderHit hit) { if (_hitComp == null) { _hitObj = hit.gameObject; // Get the GameObject from what we just collided with _hitComp = _hitObj.GetComponent(typeof(InteractionController)) as InteractionController; // Get the Interaction component if it exists if (_hitComp != null) // null check so we don't cause an error if the component doesn't exist on the object { if (!_hitComp.GetActive()) // The object is active and now interactable { print("Object is active..."); _hitComp.SetActive(true); if (_hitComp.GetCollidable()) { _hitComp.CollideInteract(); } // If this is a collidable interaction, do the interaction } } } }