Skip to content

kohzy/SharedSpheres

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 82.5%
  • Objective-C++ 13.2%
  • Objective-C 2.3%
  • ShaderLab 1.9%
  • Smalltalk 0.1%