Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

¿How to make an asymmetric multiplayer scene with ARcore?

Discussion in 'AR' started by Aupuma, Feb 20, 2018.

  1. Aupuma

    Aupuma

    Joined:
    Feb 15, 2017
    Posts:
    42
    Hi, I am doing research for my degree's final project because I want to make an asymmetric multiplayer game with Unity. One player has to use ARcore to see the scene from above and the other player is controlling a character from a FPS view, without ARcore.

    I have read the article that introduces ARinterface and I have tested uNet with both smartphones and the connection works fine, but I don't know if it is possible to have in the same scene a player that does not use AR but interacts with the scene.

    The flow of the game could be similar to the AR Tanks demo: First an AR Setup scene, then a lobby and finally the main scene.
     
  2. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Sounds interesting! The major difference between AR Tanks and the regular Tanks tutorial is the camera logic. The original tutorial has camera logic that resembles a third person tank game -- for AR Tanks, we just threw that out and made the cameras follow the AR device.

    It sounds like you want the original camera logic on, say, a PC, and the AR camera logic on Android and iOS. Your C# script can use something like
    Code (CSharp):
    1. #if UNITY_IOS || UNITY_ANDROID
    2.     ...
    3. #else
    4.     ...
    5. #endif
    to distinguish between the platforms.
     
  3. Aupuma

    Aupuma

    Joined:
    Feb 15, 2017
    Posts:
    42
    Sorry for the late response, I've been really busy with other projects! So, I have the AR Setup Scene that came with the tanks game and when I choose a plane, instead of loading a lobby scene I load a new scene with the level map.

    Code (CSharp):
    1.  
    2.         void LoadGameScene()
    3.         {
    4.             CustomNetworkDiscovery.Instance.StartBroadcasting();
    5.             NetworkManager.singleton.StartHost();
    6.             GetComponent<ARPlaneChooser> ().enabled = false;
    7.         }
    8.  
    When it loads the new scene it instantiates all the objects of the map, but the camera gets stuck with the same image and there is no tracking. However, if I connect from the other device to the same scene and move an object it is displayed correctly in the AR device, the objects in the scene are moving and acting correctly, but there is no tracking