question

maria-1 avatar image
maria-1 asked

I get a NullReferenceException

I am getting this: Object reference not set to an instance of an object PlayFab.PlayFabMultiplayerAgentAPI.Start () (at Assets/PlayFabSDK/MultiplayerAgent/PlayFabMultiplayerAgentAPI.cs:84) AgentListener.Start () (at Assets/2_Scripts/AgentListener.cs:16) error when I try and run my game in play mode. I am unsure what the issue is or why it is even an issue. I am trying to just have my AgentListener.cs even work because I am trying to have UpdateConnectedPlayers work. Any help would be great! Have been refrencing both the Mirror Sample and this Unity-on-Azure-PlayFab-Part-5-Matchmaking-with-Pla

Been trying to get this to work for a couple days and I am unsure what I am doing wrong

Custom Game ServersmultiplayerMatchmaking
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Simon Cui avatar image Simon Cui commented ·

Could you share us with which part of your codes that you got this error? Any code or screenshot would be fine.

0 Likes 0 ·
maria-1 avatar image maria-1 Simon Cui commented ·

ok. Here is line 84 - 98 of my PlayFabMultiplayerAgentAPI.cs class where I have the error on on line 84 (aka the first line) 5393-playfab-error-line-84.png

Then here is my AgentListener.cs Line 16 where the other part of error is. 5394-playfab-error-line-16.png

0 Likes 0 ·

1 Answer

·
Simon Cui avatar image
Simon Cui answered

Have you built the UnityServer project yet? If not, please follow this link https://github.com/PlayFab/MpsSamples/tree/main/UnityMirror. The detailed steps to use UnityMirror are listed in there.

6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

maria-1 avatar image maria-1 commented ·

Yes that is what I am going off of with my code

0 Likes 0 ·
Simon Cui avatar image Simon Cui maria-1 commented ·

You can directly build the UnityServer project instead of running it in play mode. Please let me know if you still have questions.

0 Likes 0 ·
maria-1 avatar image maria-1 Simon Cui commented ·

Yeah, I still have the error in the sample as well.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.