How to synchronize an object in an online game?

Hi everyone! I’m currently making a 2 player online game, in which both players can see a sheet where they can draw/erase. While one of them is painting, the other one is erasing. But well, that’s just the idea.

The problem comes when I try to implement the online functionality, for which I’m using Unet (one player is the host while the other is a client connected to that host): the changes that a player does over the sheet can only be viewed by itself. The changes the second player does, can’t be viewed on the first player’s screen.

After trying some rpc i’ve managed to make the host’s changes visible on both screens, but when I try to make the same with the client, a warning shows in the console saying that I’m trying to acces to an object without authority. The result: I’m not able to synchronize the sheet to make the changes visible on both screens. Is there any way to “share” an object so all players on the game can see it synchronized?

I don’t know what to do to solve this problem. I hope you guys can help me with this. Any help would be appreciated. Thank you very much.

Well, I finally managed to make both client and host have synchronized objects. But the way I did it is just… mmmeh. So blurry I can’t even exlplain.

And now the game runs really slow. So I still need a better answer. Does not anyone knows a way to share synchronized objects through a network?