All Projects → Unity-Technologies → SharedSpheres

Unity-Technologies / SharedSpheres

Licence: other
An example project to demonstrate an AR shared multiplayer experience using Unity ARKit Plugin for ARKit 2 and UNet

Programming Languages

C#
18002 projects
Objective-C++
1391 projects
objective c
16641 projects - #2 most used programming language
ShaderLab
938 projects
smalltalk
420 projects

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!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].