// Main Update function that get called for every frame. public override void updateStage() { // This is needed for calling step update. base.updateStage(); if (currentCombatSubStage.Equals(CombatSubStages.InCover)) { if (opponent.isHidden()) { if (opponent.isAimed()) { m_selfAgent.setTargetPoint(opponent.getTransfrom().position + new Vector3(0, 1.1f, 0) + randomOffset); } else { m_selfAgent.setTargetPoint(opponent.getTransfrom().position + new Vector3(0, 0.4f, 0) + randomOffset); } } else { m_selfAgent.setTargetPoint(opponent.getTransfrom().position + new Vector3(0, 1.25f, 0) + randomOffset); } //m_selfAgent.setTargetPoint(opponent.getTransfrom().position + randomOffset); } else { m_selfAgent.setTargetPoint(targetLocation.position + randomOffset); } }