Search Unity

Daydream controller in multiplayer

Discussion in 'Daydream' started by frigi, Feb 9, 2017.

  1. frigi

    frigi

    Joined:
    Jul 15, 2014
    Posts:
    9
    I'm having a go at connecting multiple daydreams at the moment and while a lot of it works with a few modifications to the sdk I'm not quite sure If I'm tackling the issues the right way. Has anyone here tried to get the controller to work in a multiplayer scenario before and has some useful pointers on what needs to be done?

    Transmitting basic transforms is not really an issue it's more about things like how to properly make sure that there's only one instance of e.g. GvrController while preferably keeping it in the Player Prefab. (Enabling it only on the local player like you would do with a camera throws some nullPointerExceptions as a few things don't seem to be initialized in time, even when doing it in Awake().)
    Or how to have raycasting work properly for things like menus floating in 3D space (Also after scene changes, which isn't working for me right now. I will need to investigate this a bit further though, I might just be doing something stupid...)

    All of this is obviously not a problem at all in a single player scenario but gave me quite some trouble as soon as I tried to get it to work for multiplayer.

    I would be very greatful for any input!
     
  2. mira_leung

    mira_leung

    Official Google Employee

    Joined:
    May 17, 2016
    Posts:
    70
    Could you please clarify how you're using the controller in multiplayer mode? Is this one controller with multiple headsets, or one controller each with the positions shared across all players?
     
  3. frigi

    frigi

    Joined:
    Jul 15, 2014
    Posts:
    9
    I'm trying to have multiple headset-controller-pairs in the same environment, so the latter.
    In order to get transforms replicated properly I converted GvrArmModelOffsets to a NetworkBehaviour and added the usual isLocalPlayer checks.
     
  4. mira_leung

    mira_leung

    Official Google Employee

    Joined:
    May 17, 2016
    Posts:
    70
    Our platform and Unity SDK aren't built to support multiple headset-controller pairs in the same scene, but with networking, you should be able to get the right data for rendering purposes.
     
  5. frigi

    frigi

    Joined:
    Jul 15, 2014
    Posts:
    9
    That's too bad, thanks for checking none the less!

    I seem to have everything working quite reliably it's just a little "dirty". I still need to have a GVRViewer and GVRController sitting in each and every scene in order for it to work and I had to alter a few little things in the SDK. I'm still using the preview build, not the 5.6 beta right now.
    I'll be trying to update this to 5.6 in the near future, let's see which new challanges await... :)