Search Unity

Resolved How to set port during runtime using community WebSocketTransport for Netcode in WebGL builds

Discussion in 'Netcode for GameObjects' started by carlosidrovo83, Mar 16, 2023.

  1. carlosidrovo83

    carlosidrovo83

    Joined:
    Jul 4, 2019
    Posts:
    6
    I installed the community package for WebSocketTransport for NetcodeGameobjects to enable clients using WebGL builds.
    I am trying to set the adress/port through code during runtime (getting dataa from an InputField) like I used to do with the UnityTransport but I can't seem to be able to reference the WebSocketTransport.
    Any ideas to fix this issue?
    (added an image with screenshots to better explain my problem) WebSocket Problems.jpg
     
  2. carlosidrovo83

    carlosidrovo83

    Joined:
    Jul 4, 2019
    Posts:
    6
    I was struggling with this last night until I finally gave up. This morning I booted up my system, opened the project and now it does seem to see the WebSocketTransport class just fine and it can be referenced from the rest of my code... seems like a simple reboot is all that was needed to fix the issue.