f054cdd832
Replaced removed API, updated scripting runtime, updated project settings and packages manifest |
||
---|---|---|
Assets | ||
LICENSES | ||
Logs | ||
Packages | ||
ProjectSettings | ||
.gitignore | ||
CaptainsMessREADME.md | ||
LICENSE | ||
README.md |
README.md
SharedSpheres - AR Multiplayer Experience
We want to showcase an example of two or more devices being able to share an augmented reality experience in the same space.
ARKit 2 introduced the notion of ARWorldMap which allow you to share your coordinate space with another device while interacting in AR. We use Unity ARKit Plugin to interact with ARKit 2 SDK, but we needed a mechanism to transmit the ARWorldMap between devices.
The solution for local multiplayer we settled on for this example is CaptainsMess by the inimitable Spaceteam.
This app is created with a combination of the two projects mentioned above. We start off with a scene that maps the area around your device to obtain the ARWorldMap for the area you are going to play in.
Then we go to a scene which contains the lobby (as implemented by CaptainsMess example) so that we can connect up the devices. You can choose to autoconnect or choose one device to be the host and others to be clients. Once they are connected, the host device will send its ARWorldMap to all the clients, who will all relocalize to the host device's coordinate system.
Since the ARWorldMap can be hundereds of kilobytes, and UNet does not have a mechanism to transmit large messages or files like that, we divvy them up into smaller chunks using a mechanism found here.
We also implement a sphere prefab that is registered by UNet so that it can be spawned on all clients at the same time. Then when we press a button on one client, it generates a sphere prefab of a certain color which is different from the color of the spheres generated by other clients.
Go check it out!