2

I am writing a Unity App, which connects two mobile divices using Unity Networking. One is acting as a Master (the host) and the other one as a Slave (Client). The Application should synchronously take photos from each device.

For now I am using SyncVars for achieving this. Every ten frames, the server changes a SyncVar, the onChange method of this variable is then called and both Host and Client take the photo and send it back to the Host using [Command] methods.

I am new to Unity Networking so this is my first implementation and I guess its not the best way solving this Problem.

Is there any other syncronization in UNET for this UseCase?

Thanks in advance, Mirko

mojado
  • 370
  • 1
  • 12

2 Answers2

1

You could have a method on both devices called based on the time. So set both devices to take the picture at 15:43:45 for example.

This method is then called from one to the other and the time is set before hand.

The more synchronized their clocks are the better. Perhaps you could have them hook up to an online clock.

Doh09
  • 2,324
  • 1
  • 16
  • 31
0

Try using an RPC Method (is sent to every Client from the Server) for taking the pictures. As the Server also acts as client itself, both should start the RPC Method (alsmost) synchronious. When both devices are in the same network, there should not be such a high latency taking the picture on the client.

mstranne
  • 78
  • 12