MultiplayerSynchronizer
- Add ability to sync node references
#4787
Labels
MultiplayerSynchronizer
- Add ability to sync node references
#4787
Describe the project you are working on
RTS with a lot of export nodes to link properties (e.g. the owner of an entity is a player node).
Describe the problem or limitation you are having in your project
I am happily migrating my code to utilize the new export nodes: #1048
However, I still need to keep a setter/getter for the
NodePath
for when theMultiplayerSynchronizer
syncs. Currently, trying to sync the node references directly has no behavior (bug?).Describe the feature / enhancement and how it helps to overcome the problem or limitation
When
Node
is serialized to be sent over the network, it should be converted to aNodePath
for transit.#4429 will likely be implemented in two ways:
Node
reference itself is kept in cache.Node
s in particular won't be very different.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
@export var player: Node
And in the
MultiplayerSynchronizer
:If this enhancement will not be used often, can it be worked around with a few lines of script?
Issues with this workaround though:
player_path
's value never actually changes.player_path
has a logical branch and callsget_path
every time.Is there a reason why this should be core and not an add-on in the asset library?
MultiplayerSynchronizer
is already coreThe text was updated successfully, but these errors were encountered: