0 votes

I'm creating demo game for two player using PacketPeerUDP . i create server/client script and when i send String, it will sending/receiving messages to each other without any error.

Now When i tried to send [1,2,3] or ["p1:":"123"], i'm facing error Invalid call. Nonexistent function 'to_ascii' in base 'Array'.

Does there is anyway to send array using PacketPeerUDP?

asked Apr 3, 2019 in Engine by atopetrick (120 points)

1 Answer

+2 votes
Best answer

You can use to_json to convert the array into a string, send that and use parse_json on the receiving side to convert the string back to the array again.


answered Apr 3, 2019 by wombatstampede (2,901 points)
selected Apr 3, 2019 by atopetrick

@wombatstampede thanks :)

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 How to use this Q&A? before posting your first questions.