LiveQuery
LiveQuery
The way you get information about the world is through LiveQueries. We set criteria for what part of the world we are interested in at each given moment. That way, the replicator won’t send information about everything that is going on in the game world everywhere, at all times.
Instead, we will just get information about what’s within a certain area, kind of like moving a torch around to look in a dark cave.
More complex areas of interest types are coming in future versions of coherence.
Adding a LiveQuery to the scene
A LiveQuery is a cube that defines the area of interest in a particular part of the world. It is defined by its position and its radius (half the side of the cube). There can be multiple LiveQueries in a single scene.
Moving a LiveQuery
A classic approach is to put a LiveQuery on the camera and set the radius to correspond to the far clipping plane or visibility distance.
Moving the GameObject containing the LiveQuery will also notify the replication server that the query for that particular game client has moved.
Last updated