How do I fix using namespace does not exist in the current context: using Unity.Services.Matchmaker

I am working with a tutorial on Netcode for GameObjects and I am at a dead end.

I need a namespace for some of the code to work and apparently it does not exist in the current context, but it should.


This image shows that Matchmaker package IS currently installed. I’m assuming that’s where the namespace comes from.

9770775--1400142--upload_2024-4-14_22-17-29.png
This image shows that Unity.Services only have three options, none of which is Matchmaker.

9770775--1400145--upload_2024-4-14_22-18-25.png
This image shows the full namespace I need and that Matchmaker is invalid.

9770775--1400148--upload_2024-4-14_22-19-2.png
This image shows the error.

I have searched online and apparently I’m the only person on earth to ever have this issue with this particular namespace. Any help is greatly appreciated. Thank You.

Possibly the tutorial is based on different versions of editor, netcode and matchmaking. Check which versions were used and use those.

Matchmaker package in tutorial is using 1.0.0 and I’m using 1.1.2. I’m also using the same editor version. I always do that now because of problems in the past following tutorials. When I looked up Unity.Services.Matchmaker on the Unity documentation, it just explained what classes are available. It didn’t provide much more information, such as where the namespace originates, etc. I think Unity documentation should include additional information.

Do you use assembly definitions? Perhaps you only need to add the Matchmaker dependency.

1 Like