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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Bug Editor 2020.3.30f1 bytesize Invaders WebGL target is missing classes necessary to build

Discussion in 'Unity Transport' started by KingKRoecks, Mar 13, 2022.

  1. KingKRoecks

    KingKRoecks

    Joined:
    Jul 28, 2013
    Posts:
    108
    BaselibNetworkParameterExtensions, BaselibNetworkParameter, etc

    When I build on Windows, I have no issues resolving to these classes. As soon as I switch to WebGL build, I get this error:

    Code (csharp):
    1. Library\PackageCache\com.unity.netcode.adapter.utp@1.0.0-pre.6\Runtime\UnityTransport.cs(900,18): error CS1061: 'NetworkSettings' does not contain a definition for 'WithBaselibNetworkInterfaceParameters' and no accessible extension method 'WithBaselibNetworkInterfaceParameters' accepting a first argument of type 'NetworkSettings' could be found (are you missing a using directive or an assembly reference?)
    2.  
    I've tried a few different versions of the Unity Transport for Netcode for GameObjects versions.
    No luck.

    upload_2022-3-13_12-31-30.png
     
    okiaki likes this.
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    150
    Oh, good catch! We had fixed these errors for Unity Transport itself, but not for its adapter for NGO. I'll get this fixed in the next release (1.0.0-pre.7). Thanks for reporting the issue.

    Please note however that WebGL is not officially supported (yet) by Unity Transport. We'll fix compilation errors so that someone can at least have the package installed in WebGL projects (e.g. if one is using different transports for WebGL and non-WebGL builds), but I wouldn't expect Unity Transport to do anything useful when used in WebGL.
     
    okiaki likes this.
  3. KingKRoecks

    KingKRoecks

    Joined:
    Jul 28, 2013
    Posts:
    108
    Yeah, I've seen that the Unity Transport is not supposed to work. What about the websocket transport implementation though? WebGL should support that, I'd imagine, but all the things explicitly checking #if !UNITY_WEGBL and commenting out their implementation seem like it might be a hurdle to attempt to test it.
     
  4. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    150
    You mean the WebSocket community transport? Yes I would presume this works fine on WebGL. You should be able to install it without installing the Unity Transport adapter, though. Ultimately, Unity Transport is just one of many possible transports for NGO (albeit one with official support).
     
    KingKRoecks likes this.
  5. KingKRoecks

    KingKRoecks

    Joined:
    Jul 28, 2013
    Posts:
    108
    Got it! Yeah, I figured that was likely the case. I just can't build with these issues despite specifically targeting WebGL for a free game I wanted to make :(.

    I should say, I was able to remove one of the "#if !UNITY_WEBGL" scopes and got it to build, but then there are further issues as soon as you load up the Build & Run result.

    Before the NetworkManager is ever told to start a socket, Unity will get stuck on the loading bar and fail to load the game.
    Creating a test project with WebGL, loads fine.
    Add Netcode for Gameobjects and get it to build, doesn't load.

    Currently waiting on a resolution from the bug in this other thread: https://forum.unity.com/threads/webgl-build-wont-load.1238800/#post-7955730

    It could be the same issue, but wanted to put it on your radar as well just in case it's not.
     
  6. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    150
    Ah right, I wasn't aware there were WebGL issues with Netcode for GameObjects itself.

    Still, thanks for reporting the separate issue for Unity Transport. The fix has been merged and will be in 1.0.0-pre.7.
     
    KingKRoecks likes this.
  7. HugoDidimo

    HugoDidimo

    Joined:
    Aug 6, 2018
    Posts:
    2
    Was this issue solved? I can't find com.unity.netcode.adapter.utp@1.0.0-pre.7.
    I have the same error as the OP on WebGL.
     
  8. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    150
    Package
    com.unity.netcode.adapter.utp
    has been merged in
    com.unity.netcode.gameobjects
    as of version 1.0.0-pre.7 (current version is 1.0.0). What version of Netcode for Gameobjects are you using?