Passing object references as parameters using Godot's high level networking functions (e.g. `remote`)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By shianiawhite
:warning: Old Version Published before Godot 3 was released.

What happens when you call a function remotely using Godot’s high leveling networking, but passing objects (or object references) as a parameter? Is Godot able to match up the object with the equivalent object on the remote side (if available)? Or does it try to send the whole object? Or something else? Thank you!

I assume it would not work because plain object references can’t be matched from one client to another, unless you create a system to do so (like giving them IDs to recognize objects on every client, or sending them as values if IDs don’t matter). Only nodes have a way to be identified somehow because they have a recognizable path which is (hopefully) the same on all clients.
But I never played with Godot networking yet so can’t say much more.

Zylann | 2017-11-23 19:32

Has anyone else answered this query? I’m fairly new to Godot and if somebody can answer this question, it would really be helpful! :slight_smile:

macabilo | 2020-08-24 07:23