0 votes

Is there a built-in way of copying a node with all it's current attributes and child nodes (with all their current attributes) from a server to a client? I would hope to use this as an easy initialization to make the client match the server, then handle the rest of the communication with RPC calls after that. I understand that this may not exist, probably because several low level attributes should not be exactly duplicated on both systems, but ideally (for me) there would be a way to duplicate this that handles this in a way that doesn't duplicate those low level attributes that it shouldn't.

If such a built-in method does not already exist, are there any (high-level) suggestions as to how I should implement this method on my own? My initial plan would be to iterate over all pieces of the node and child nodes, creating them and setting their parts to the current attributes. And if it's not a built-in method, I would probably want to "whitelist" what attributes and child nodes should be duplicated. This would make adding arbitrary things more work, but I would be afraid of breaking lots of things trying to blacklist the attributes that should not be copied as I'd probably miss things. However, other suggestions would be appreciated. Thank you!

in Engine by (108 points)

Please log in or register to answer this question.

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 webmaster@godotengine.org with your username.