What is the best way to sync object references across clients?
I want to be able to synchronize a reference to a game object accross clients?
Currently, the way I'm doing it is by creating a unique identifier string in a custom RealtimeComponent that syncs across clients. Then, when we need to reference that game object, we can reference that string, search for it on all clients, and get the game object reference.
However, this feels a little clunky. I have to assign this custom component to each object that I want to reference.
Is there a better way? I thought about using the viewUUID in realtimeView but it is null for realtimeViews that were instantiated in a prefab.
Any ideas?
Currently, the way I'm doing it is by creating a unique identifier string in a custom RealtimeComponent that syncs across clients. Then, when we need to reference that game object, we can reference that string, search for it on all clients, and get the game object reference.
However, this feels a little clunky. I have to assign this custom component to each object that I want to reference.
Is there a better way? I thought about using the viewUUID in realtimeView but it is null for realtimeViews that were instantiated in a prefab.
Any ideas?