Search Unity

Resolved UnityTransport not found???

Discussion in 'Unity Transport' started by amirasfour40, May 5, 2022.

  1. amirasfour40

    amirasfour40

    Joined:
    Apr 30, 2021
    Posts:
    7
    I am following this tutorial: Unity multiplayer tutorial using Unity Services - Netcode, Authentication, Lobby and Relay - YouTube

    Everything works except this: NetworkManager.Singleton.GetComponent<UnityTransport>().SetRelayServerData(

    Unity tells me it does not know UnityTransport although i have the script in my project. I am stuck for an hour now: Assets\GameManager.cs(97,51): error CS0246: The type or namespace name 'UnityTransport' could not be found (are you missing a using directive or an assembly reference?)
     
  2. amirasfour40

    amirasfour40

    Joined:
    Apr 30, 2021
    Posts:
    7
    Fixed it. Use this: using Unity.Netcode.Transports.UTP;
     
    CodeNinja- and umitumuzer like this.
  3. piyush1011

    piyush1011

    Joined:
    Nov 23, 2016
    Posts:
    10
    I thing same error
    How to solve this unity Netcode error?
    Library/PackageCache/com.unity.netcode.gameobjects@1.3.1/Runtime/Transports/UTP/SecretsLoaderHelper.cs(71,56): error CS0246: The type or namespace name 'UnityTransport' could not be found (are you missing a using directive or an assembly reference?)
     
  4. CodeNinja-

    CodeNinja-

    Unity Technologies

    Joined:
    Feb 22, 2023
    Posts:
    27
    Hi piyush1011,

    It's been a while since you posted but I was wondering if you tried adding
    using Unity.Netcode.Transports.UTP;
    to your script as amirasfour40 suggested?
     
  5. stickylab

    stickylab

    Joined:
    Mar 16, 2016
    Posts:
    92
    what about this ? i cannot add using Unity.Netcode.Transports.UTP; to that script , so it still failed

    upload_2024-2-1_23-44-55.png
     
  6. piyush1011

    piyush1011

    Joined:
    Nov 23, 2016
    Posts:
    10
    First, remove the Netcode package then again install the package.