Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

any way to get user name from Oculus SDK?

Discussion in 'VR' started by JoeStrout, Sep 1, 2018.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I'm making a multiplayer game, and I'd like to display a user-recognizable name without making the user actually enter it in my game.

    I thought OVRManager.profile.name would do it, but no such luck — that's returning an empty string for me.

    Any ideas how to do this? Or must we each have an "enter name" screen in our games?
     
  2. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    For the oculus user name, i think you are required to use Oculus Platform SDK. This requires a Platform init call and a successful passed app entitlement check ( checks whether the user owns the app )d
    Than you can grab the oculus user via the following call ( which contains the username plus other stuff like a DL link to the profile picture )
    Platform.Users.GetLoggedInUser()


    Here's some intro guide
    https://developer.oculus.com/documentation/platform/latest/concepts/book-pgsg/

    requires some initial learning, but the Platform SDK opens a huge amount of social capabilities for VR...
    PS: it's possible that the
    OVRManager.profile.name
    gets filled with the oculus user name after the platform init call, but that's just an assumption from my side ( i did not check )
     
    KooHoo and JoeStrout like this.
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Thanks. I suspect I was going to have to get into that anyway to make use of the Oculus VoIP chat features, which is also on the to-do list. But it wasn't clear to me (until now) that the Platform SDK was different from the SDK bits already accessible via OVRManager etc.

    Time to roll up my sleeves and dig in!
     
  4. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Yep, use VOIP on a project currently too, together with the new Avatar system to drive remote presence, and the mouth animation supported by the Avatar API, this is a real great base platform for shared VR experiences
     
    JoeStrout likes this.
  5. FaridCG

    FaridCG

    Joined:
    Nov 17, 2016
    Posts:
    4
    When I try to use "Platform.Users.GetLoggedInUser()" i get the error "This function requires an initialized Oculus Platform. Run Oculus.Platform.Core.[Initialize|AsyncInitialize] and try again."
     
  6. RiverExplorer

    RiverExplorer

    Joined:
    Jul 28, 2021
    Posts:
    17
    (THIS WEB PAGE NO LONGER EXISTS!)

     
  7. RiverExplorer

    RiverExplorer

    Joined:
    Jul 28, 2021
    Posts:
    17

    URL no longer valid.