question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullReferenceException when using SteamP2P Transport

See original GitHub issue

I am using the SteamP2P Transport and have a simple setup for a lobby in unity. When trying to join a hosted game as a client, after a few seconds a NullReferenceException gets thrown in the NetworkManager.cs, at line 1144: MessagingSystem.ProcessIncomingMessageQueue();

Then the NetworkManager.Singleton.OnClientDisconnectCallback is called, against what the NetworkManager.Singleton.OnClientConnectedCallback never gets called (so the client never connects properly).

Here are two threads, where people describe the similar problems:

  1. https://answers.unity.com/questions/1869491/messagingsystemprocessincomingmessagequeue-nullref.html?childToView=1870613
  2. forum.unity.com/threads/anyone-have-sample-mlapi-with-steam-matchmaking.1098304/

I am using:

  • Unity 2020.3.20f1
  • Netcode for GameObjects 1.0.0-pre.3
  • Multiplayer Tools 1.0.0-pre.2
  • SteamP2P Transport for Netcode for GameObjects 2.0.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
LukeStampflicommented, Dec 27, 2021

For the Photon based transport #118 was necessary after the latest change. There was a change to how the ids need to be passed in the connected and message events.

0reactions
daniellochnercommented, Aug 18, 2022

Hi @ElwoodHogan, did you ever manage to get it working? I’m having issues with Lobby not working properly with the Steam transport.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Anyone have Sample MLAPI with Steam Matchmaking?
Netcode, which is almost identical, but I keep getting a wierd NullReferenceException: Object reference not set to an instance of an object  ......
Read more >
NullReferenceException: Object reference not set to an ...
Having the same issue: Using Unitys netcode with the steamp2p transport, but i am not able to properly connect as a client. The...
Read more >
Steamworks and Unity – P2P Multiplayer
It is a good start, but now let's go further and talk about multiplayer in Steam. This won't be a tutorial, but a...
Read more >
c# - Getting a NullReferenceException when trying to ...
At line 29 (where targetEnemyUnit is instantiated) during game tests I get a NullReferenceException error which I figure means Instantiate ...
Read more >
Trying to install custom Transports for Unity Netcode ...
Trying to install custom Transports for Unity Netcode for Gameobjects; (Steam P2P to be exact) The website on the Official documentation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found