-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpc and rpc_id fail when argument is PackedVector2Array #64623
Comments
@jjanella Please upload a minimal reproduction project to make this easier to troubleshoot. PS: Code blocks should use triple backticks like this (with an optional language name for syntax highlighting): ```gdscript I edited your post accordingly, but remember to do this in the future 🙂 |
Project: Every time a client connects every client gets another triangle on their screen. For it to work, host and client need workaround checked. |
I can't reproduce the error in Godot 4.2.1.stable and can send PackedVector2Array successfully. But instead, I got an error from sending an empty PackedByteArray.
@jjanella Seems you added an empty zip file. So I will add mine instead. base.gdextends Node
class_name Base
func _ready() -> void :
multiplayer.connected_to_server.connect(func() : print("Connected"))
multiplayer.peer_connected.connect(_peer_con)
func _peer_con(peer : int) -> void :
var data = PackedByteArray()
sync_points.rpc_id(peer, data)
@rpc("any_peer", "unreliable_ordered")
func sync_points(data) -> void :
print(data) server.gdextends Base
func _ready() -> void :
super()
print("server")
var peer := ENetMultiplayerPeer.new()
peer.create_server(5555, 2)
multiplayer.multiplayer_peer = peer client.gdextends Base
func _ready() -> void :
super()
print("client")
var peer := ENetMultiplayerPeer.new()
peer.create_client("127.0.0.1", 5555)
multiplayer.multiplayer_peer = peer |
That is odd that it was empty, thank you |
Godot version
4.0.dev (462bb3b)
System information
Arch Linux - I dont think this is an issue with my computer but i can provide logs/more specs if nessecary
Issue description
As the title says, trying to send a PackedVector2Array as the argument over rpc or rpc_id will fail. I work around it by packaging the PackedVector2Array inside an array and unpackaging it on the client side.
Steps to reproduce
Put this code in a multiplayer game. Have a client or server run it. Nothing happens or it crashes without explanation.
Minimal reproduction project
Project: Every time a client connects every client gets another triangle on their screen. For it to work, host and client need workaround checked.
rpc_tests.zipIssue with the zip but a different one was provided by gongpha below.
The text was updated successfully, but these errors were encountered: