Search Unity

Multiplayer (Photon Bolt) AR with Vuforia

Discussion in 'AR/VR (XR) Discussion' started by donfour, Jan 3, 2019.

  1. donfour

    donfour

    Joined:
    Aug 12, 2018
    Posts:
    5
    Hi everyone!

    TLDR:
    I would like to create a shared AR, where I would like to:
    1. spawn a cube for each player on an ImageTarget
    2. allow them to control the position of their cube
    3. allow them to see the movements of all other players' cubes

    Right now I'm facing an issue where each player can only see his/her cube, but not the other players' cubes.

    Situation:
    So far, I'm following the tutorial from Photon Bolt (here). I've reached the point where I have achieved (2) and (3) but without AR (here). The next thing I did was to add Vuforia to the project based on that code, by dragging in an ARCamera, adding an ImageTarget as its child and deleting the main camera. And here is the only script I modified.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. [BoltGlobalBehaviour]
    5. public class NetworkCallbacks : Bolt.GlobalEventListener
    6. {
    7.     public GameObject imagetarget;
    8.  
    9.     public override void SceneLoadLocalDone(string map)
    10.     {
    11.  
    12.         // get imagetarget
    13.         imagetarget = GameObject.Find("ImageTarget");
    14.  
    15.         // instantiate cube
    16.         GameObject newCharacter = BoltNetwork.Instantiate(BoltPrefabs.Cube, imagetarget.transform.position, Quaternion.identity);
    17.  
    18.         newCharacter.transform.localScale = new Vector3(5, 5, 5);
    19.  
    20.         // set newCharacter to be a child of ImageTarget
    21.         newCharacter.transform.parent = imagetarget.transform;
    22.     }
    23. }
    I'm new to multiplayer AR game development, and this is for a school project. I'm pretty lost. Would really appreciate it if someone can point me to what might be the problem!!! (I'm open to ditching Photon Bolt and using another networking library if someone has had success with it!)