Giter Site home page Giter Site logo

unity-technologies / sharedspheres Goto Github PK

View Code? Open in Web Editor NEW
84.0 12.0 25.0 10.84 MB

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

License: Other

C# 82.38% ShaderLab 1.91% Objective-C++ 13.25% Objective-C 2.31% Smalltalk 0.15%

sharedspheres's Introduction

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!

sharedspheres's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sharedspheres's Issues

Does this demo still work on Unity 2018.3?

I compiled this on two iOS devices, but the app never gets to ExamplePlayerScript for sphere placement... I've been able to go from the worldmap scanning to the connection screen to the lobby (which is blank with a ready/unready button). Going to keep debugging, but wondering why I can't seem to get this working to place spheres. On unity 2018.3, but also tried 2018.4 and 2018.2 with same results.

`UnityEngine.Network' is obsolete: `The legacy networking system has been removed in Unity 2018.2.

After importing the project, I got 3 errors messages:

Assets/CaptainsMess/CaptainsMessDebugGUI.cs(21,44): error CS0619: UnityEngine.Network' is obsolete: The legacy networking system has been removed in Unity 2018.2. Use Unity Multiplayer and NetworkIdentity instead.' Assets/CaptainsMess/CaptainsMessDebugGUI.cs(21,44): error CS0619: UnityEngine.Network.player' is obsolete: The legacy networking system has been removed in Unity 2018.2. Use Unity Multiplayer and NetworkIdentity instead.' Assets/CaptainsMess/CaptainsMessDebugGUI.cs(21,51): error CS0619: UnityEngine.NetworkPlayer.ipAddress' is obsolete: The legacy networking system has been removed in Unity 2018.2. Use Unity Multiplayer and NetworkIdentity instead.'

And when I tried building the project on iOS, I got this one more message:

UnityEditor.BuildPlayerWindow+BuildMethodException: Error building Player because scripts have compile errors in the editor at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:187 at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:94 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
I am new to Unity so I don't know which one to focus on. Any help will be appreciated

Silent Broadcast Failures on IOS devices

Can connect up a mac running the app in editor with an ipad on the same network, but not two ipads on the same network.

Finding that auto connect running on one ipad while another hosts doesn't seem to show any broadcasting from the other device in received broadcasts.

I know you didn't really work on the captainsmess example and I should contact them directly but wondered if you experienced this issue internally?

Wait For Location Sync stuck for a very long time

Sync was successful only once then tried to reload still can't sync. I created network on my laptop and both devices connected to it because it doesn't work with a wifi connection (maybe firewall issues)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.