private void LateUpdate()
    {
        if (_agentController != null)
        {
            _agentController.UpdateFields();
        }

        List <Name> eventsToPerceive = new List <Name>();

        if (rpcList != null && _agentControllers != null)
        {
            foreach (var agent in _agentControllers)
            {
                if (agent.getJustReplied())
                {
                    var lastAction   = agent.getLastAction();
                    var actionTarget = agent.getLastAction().Target;
                    var TargetRPC    = _agentControllers.Find(x => x.RPC.CharacterName == actionTarget);
                    agent.setFloor(false);
                    justSpokeAgent = agent;
                    Debug.Log(justSpokeAgent.RPC.CharacterName + " property Friendship towards " + actionTarget + justSpokeAgent.RPC.m_kb.AskProperty(Name.BuildName("Friendship(" + justSpokeAgent.RPC.CharacterName + "," + TargetRPC.RPC.CharacterName + ")")));
                    Debug.Log(justSpokeAgent.RPC.CharacterName + " property Attraction towards " + actionTarget + justSpokeAgent.RPC.m_kb.AskProperty(Name.BuildName("Attraction(" + justSpokeAgent.RPC.CharacterName + "," + TargetRPC.RPC.CharacterName + ")")));
                    Debug.Log(TargetRPC.RPC.CharacterName + " property Friendship towards " + justSpokeAgent.RPC.CharacterName + TargetRPC.RPC.m_kb.AskProperty(Name.BuildName("Friendship(" + TargetRPC.RPC.CharacterName + "," + justSpokeAgent.RPC.CharacterName + ")")));
                    Debug.Log(TargetRPC.RPC.CharacterName + " property Attraction towards " + justSpokeAgent.RPC.CharacterName + TargetRPC.RPC.m_kb.AskProperty(Name.BuildName("Attraction(" + TargetRPC.RPC.CharacterName + "," + justSpokeAgent.RPC.CharacterName + ")")));

                    agent.ClearTempVariables();
                    m_dialogController.Clear();

                    foreach (var aux in _agentControllers)
                    {
                        aux.RPC.Perceive(eventsToPerceive);
                        aux.UpdateEmotionExpression();
                    }


                    if (lastAction.Name.ToString().Contains("Finalize"))
                    {
                        //  Debug.Log(" last event " + lastEvent.ToString());
                        RandomizeNext();
                    }

                    else
                    {
                        var go = _agentControllers.Find(x => x.RPC.CharacterName == actionTarget);

                        if (go.RPC != null)
                        {
                            if (go.RPC.CharacterName == _chosenCharacter)
                            {
                                chosenTarget = agent.RPC.CharacterName;
                                PlayerReplyTurn();
                            }

                            else
                            {
                                Debug.Log(" Next NPC: " + go.RPC.CharacterName);
                                go.setFloor(true);
                                Timeleft = TIME_LEFT_CONST;

                                go.StartBehaviour(this, VersionMenu);
                            }
                        }
                    }
                    return;
                }
            }
        }
    }