Search Unity

'UnityTransport' could not be found

Discussion in 'Unity Transport' started by vchur12371, Apr 8, 2022.

  1. vchur12371

    vchur12371

    Joined:
    Mar 29, 2022
    Posts:
    1
    The type or namespace name 'UnityTransport' could not be found (are you missing a using directive or an assembly reference?)

    in my script i wrote:
    public bool IsRelayEnabled => Transport != null && Transport.Protocol == UnityTransport.ProtocolType.RelayUnityTransport;
    Please Help!!
     
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    What version of Netcode for GameObjects are you using?

    If it's the newly-released 1.0.0-pre.7, you should add a using directive for the namespace
    Unity.Netcode.Transports.UTP
    , since that's where the
    UnityTransport
    component has been moved. (You should also make sure package
    com.unity.netcode.adapter.utp
    is uninstalled, although that should be taken care of automatically.)

    If you're using 1.0.0-pre.6 or below, make sure package
    com.unity.netcode.adapter.utp
    is installed. Or update to 1.0.0-pre.7, which would actually be my recommendation here.