0 votes

I am attempting to make a game that takes your IP address and simplifies it so that you can use it as a party code. I am also attempting to make this game cross-platform so that it can be run from iOS, Mac, Windows, Android, Linux and on Itch. How would I get the IPv4 address without having to exactly find the IPv4 on every device. I also can't just go and do every device because I don't have most of the devices I listed above. Is there just a code that grabs JUST your IP address. (also I have tried IP.getlocaladdresses() but it is different on every platform.) For example this is the kind of code I want:

print(get_local_IPv4())

What is was hoping that line of code would do is return "192.168.1.2" (Example IP) or whatever my IP was.

in Engine by (62 points)

1 Answer

0 votes
Best answer

Maybeone of these answers help you. I think there isn't a way to get the address for all devices with one code. (Please tell me if I'm wrong.)

by (224 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.