Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Can I use both LLAPI and HLAPI at the same time?

Discussion in 'Multiplayer' started by rishi-ranjan, Oct 18, 2015.

  1. rishi-ranjan

    rishi-ranjan

    Joined:
    Oct 7, 2015
    Posts:
    22
    Hi I would like to use both HLAPI and LLAPI in my game. The reason is that I would like to do state synchronization using HLAPI and large message transfer using LLAPI.

    I tried doing this but Unity complains that there are two NetworkManagers in the scene one will be ignored.
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yes you can use both at the same time. But why do you think you need 2 NetworkManagers? (you don't). Pretty sure its something you're doing.
     
  3. rishi-ranjan

    rishi-ranjan

    Joined:
    Oct 7, 2015
    Posts:
    22
    I don't need two NetworkManagers. But as soon as I add NetworkTransport.Init() in my scripts, I see this warning. I will try again.
     
  4. rishi-ranjan

    rishi-ranjan

    Joined:
    Oct 7, 2015
    Posts:
    22
    I tried it today. As soon as I add LLAPI calls to my script, I see warning "
    Multiple NetworkManagers detected in the scene. Only one NetworkManager can exist at a time. The duplicate NetworkManager will not be used.
    UnityEngine.Networking.NetworkManager:Awake()".


    Please let me know if I am doing something wrong or it's even possible to use HLAPI and LLAPI at the same time.

    "
     
  5. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    The NetworkManager uses the LLAPI in the background, so you can definitely use both simultaneously.

    That 'Multiple NetworkManagers detected' warning is given by the NetworkManager's Awake() function that checks whether NetworkManager.singleton already exists, so it has nothing to do with NetworkTransport.Init(). You might have a NetworkManager in the online scene too, or two in your offline scene?