system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
sleepy |
|
Old Version |
Published before Godot 3 was released. |
Is there a way in GDscript to obtain PC/device IP address?
looking in the search help
in godot there is an IP
class with get_local_addresses()
. take a look there
tiernich | 2016-03-27 15:41
system
4
|
|
|
|
Reply From: |
rwrz |
Sure, as our friend (tiernich) said, get_local_addresses()
return all your addresses. Here an example:
print("IP:", IP.get_local_addresses())
Outputs:
IP:192.168.1.2, 127.0.0.1
So, just use IP.get_local_addresses()
to get a String with all your IPs.
Remember IP.get_local_addresses() returns an array.
Merlin1846 | 2021-04-18 23:04