How to move to next section automatically?


        private bool _hasSpeechStarted = false;
        private bool _hasSpeechEnded = false;
        public override void Update()
        {
            // Check if the AI Assistant has started speaking
            if (_hasSpeechStarted == false)
            {
                if (_aiAssistantStateMachine.AIAssistantManager.ConvaiNPC.IsCharacterTalking)
                {
                    _hasSpeechStarted = true;
                }
            }
            // If the AI Assistant has started speaking, check if the speech has ended
            else if (_hasSpeechStarted && _hasSpeechEnded == false)
            {
                if (_aiAssistantStateMachine.AIAssistantManager.ConvaiNPC.IsCharacterTalking == false)
                {
                    _hasSpeechEnded = true;
                    _aiAssistantStateMachine.OnStateEnd();
                }
            }
        }

This works, but feels a bit messy.
Looking for a reply and solution from convai. Otherwise I’ll accept this as a solution.
Thanks