- Home /
unity 2020 , netcode for gameobject , how to connect another pc?
I'm using netcode for gameobject in unity 2020 ,everything is fine in local net but I want to connect to another pc in another place via internet ,what should I do?i I gave its address but I couldn't connect to it
Answer by Captain_Pineapple · Mar 24 at 12:01 PM
Hey there,
this is not really an issue of unity but of your network setup. if you open a command line and execute this:
ping <your_target_ip>
you'll see that it is not reachable. There are a ton of possible reasons for this, but most likely the target you try to reach is some friends PC which is not an exposed host to the internet? To make this work you'd at least need proper port forwarding in your routers on both ends.
Long story short: if you can't ping it unity will not be able to reach it.
As a sidenote: try to not post your target IPs publicly as you did in your image.
hello thanks for the answers you are right I was trying to connect to an IP that was not reachable .
sorry but I have another question, I used cmd ping and the new IP is fine but I still cant connect as a client can you explain a little more please?
As i already somewhat mentioned in my first post: It depends on what your target is. Is it a private PC behind a Router?
If that is the case you'd have to create a port forwarding on the target router to the machine in the local network. then you have to target the IP of the router on the port which forwards to the actual PC behind the router.
If you could describe more about your network setup that would help a lot.
yes its a private pc behind a Router ,its all I know , can you show me a tutorial to know what to do or please explain a little more, I just want to click host button ,then the host starts and if another pc clicks on client server ,it should be able to connect me :) and as I said on local network everything is fine I just have to set ip to localhost :)
Your answer

Follow this Question
Related Questions
How do I setup the Unity Network Connection Facilitator 0 Answers
The network system work only for host 0 Answers
RPC Call Mix Up Issues 0 Answers
Get RPC senders ID, or IP? 1 Answer