I need Help with Multiplayer I can server but not use client

I have some multiplayer code, and I know it works because I have confirmed it with other players who are using the same code. It’s the generic code where you can type in your name, ip, and connect or host on the top left, im sure we all know which code im using.

I am trying to connect a client and a server locally on my computer. I have been able to host a server, but I cannot connect to the server locally with my client.

My default gateway is 192.168.2.1

When I try to host on 192.168.2.1 it lets me. When i try to connect on this same ip with another instance of the game as client, it will not let me do it. I have tried many different combinations of ips, ports, and clients. Nothing is working.

What am I doing wrong, this is really costing me a lot of time? Usually I can figure this stuff out on my own very easily but I have run into a BRICK WALL.

No i dont have firewalls, routers, nothing. All third party disabled. I just want to be able to connect my client and server instances locally on my computer. I am being as specific as I can without posting the generic code and telling you guys what my favorite color is.

Are you running client from Unity itself or from a build? I just tried to do the same ,i build the game and create a server from unity itself and a client from my build.

In my second experiment i used local ip 127.0.0.1 and it also worked.

You propably forgot the most important thing for server-client applications in Unity:

You have to check Run-In-Background in the ProjectSettings or via scripting.

Otherwise the server can't process the connect of the client because it doesn't have the focus. When you switch over to the server it will process the connect, but the client doesn't react to that since the client is now in background.

thanks guys. yea it was the run in backround thing. i just realized someone had answered this. thanks again.