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. Dismiss Notice

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:
    7
    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:
    26
    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?