I have been just fine testing and building this game for Windows and Mac but when I try and build for Windows Store Universal 8.1 I have a couple of errors, all the same:
In each case I am doing the same thing which is getting the local ip address using the following code:
Network.player.ipAddress
If I change the code to specify that it’s the Unity Engine Network class as follows:
UnityEngine.Network.player.ipAddress
Then I get the following error:
It is UnityEngine.Networking
The “Network” class is from the old networking system and deprecated. It does not work in conjunction with Unet.
That makes sense. How would I access a player’s local or public ip in Unet?
NetworkServer.connections will give you a list of all NetworkConnections to clients.
There you’ll find the “address” member.
For each client it’s NetworkClient.connection
You shouldn’t need to be connected to anyone to know your own ip.
Also, this won’t necessarily return the same thing because if the client is the server too (i.e. the host) then it will say their connection is localhost or localserver etc, it won’t return the ip.
Migrated an old 2017 project to 2023. Most issues were due to Unity not using UnityUI anymore. Could solve most things by:
Window-> Package Manager → Search For: UI
Packages= Unity Registry
Install that thing
1 Like
In Unity go to: Window > Package Manager > Unity Registry (in the sidebar) > Unity Transport, then install it.