oculusUserID Confusion Social Sample. Can't Get Personalized Avatars to Work. — Oculus
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

oculusUserID Confusion Social Sample. Can't Get Personalized Avatars to Work.

raeldorraeldor Posts: 54
Hiro Protagonist
I'm trying to get the personalized avatars to work in the social starter but they're still coming out as a gray base model.  In the documentation it says...

After getting a user ID, we then can set the oculusUserID of the Avatar accordingly. The timing is important, because we have to set the user ID before the Start() function in OvrAvatar.cs gets called.

And yet in the sample, the code sets...

        remoteUser.RemoteAvatar.oculusUserIDInternal = userID;

To add to the confusion this field is a ulong, yet oculusUserID is a string.  Even more weird is in the Start() code for OvrAvatar it says...

            oculusUserIDInternal = UInt64.Parse(oculusUserID);

Which makes it seem like the field that's being set in the social starter is being overwritten immediately.  I've tried adding the code...

        remoteUser.RemoteAvatar.oculusUserID = userID.ToString();

and also out of desperation...

        remoteUser.RemoteAvatar.oculusUserID = oculusID; // from user.OculusID in RoomManager.ProcessRoomData()

But neither seem to give customized avatars.

Anyone have any other ideas?
Thanks

Comments

  • raeldorraeldor Posts: 54
    Hiro Protagonist
    edited July 2018
    Looks like this may be some kind of a shader issue.  But does anyone know what mobile shaders to assign to the RemoteAvatar slots?

    Also, the hands are 10 foot above my head.  I'm going to hazard a guess this maybe wasn't tested on the Oculus Go?
  • Heaney-555Heaney-555 Posts: 111
    Art3mis
    You are using a pre-placed RemoteAvatar in the scene instead of instantiating in code, right?

    If so, you need to have it start disabled (ie. uncheck the checkmark for it in Hierarchy), feed the oculusUserID (do NOT use the oculusUserIDInternal field!) to it before it loads, and then SetActive(true) once that ID has been assigned.

    As for the hands thing, that's a bug right now, you need to just manually lower the Y value of the position for Go / Gear VR.
  • owenwpowenwp Posts: 681 Oculus Start Member
    In the 1.27 sample framework bundle, both the avatar user ID field and the platform user ID field are ulongs, but still don't work. I always get the default avatar.
  • raeldorraeldor Posts: 54
    Hiro Protagonist
    Appreciate the fixes.  I will put this in now and try it out.  Do you any recommended fixes for mobile shaders and broken body/hand/leg positioning too?  Thanks!
  • Ross_BeefRoss_Beef Posts: 170 Oculus Staff
    Hey there - what, specifically is the shader issue you’re seeing?

    also - the hand offset is also fixed in 1.28
  • raeldorraeldor Posts: 54
    Hiro Protagonist
    edited July 2018
    Appreciate the update.

    So, the other person's avatar takes on the custom shape, but everything is still gray.  Also, the head does not move up and down or yaw either.  Sorry to keep adding to your problems. :dizzy:

    Is the hand (or is it body problem, since the body is below the torch-light?) offset fix something I can change in the code?
  • raeldorraeldor Posts: 54
    Hiro Protagonist
    Fixed the height issue by changing to...

        private const float mobileBaseHeadHeight = 0.0f;

    on the OvrAvatarLocalDriver.  Not sure if that will screw things up on GearVR but it fixes Oculus GO.  Texture issues and head not moving up/down/yaw+- still outstanding.
  • raeldorraeldor Posts: 54
    Hiro Protagonist
    edited July 2018
    Is there a release date for 1.28 yet, as it seems to be one problem after another trying to use this with the Oculus Go? I tried fixing the height problem by putting in this bolded line...

            if (GetIsTrackedRemote())
            {
                CurrentPose = new PoseFrame
                {
                    voiceAmplitude = voiceAmplitude,
                    headPosition = new Vector3(headPos.x, headPos.y-1.3f, headPos.z),

    But all it does it change the hand height and not the head height.  How are they not linked?!  Why is the avatar position relative to the hand not linked?

     Thanks
  • raeldorraeldor Posts: 54
    Hiro Protagonist
    Also, does anyone know how the remote avatars om the list get rendered?  They doesn't seem to have any parent transform.
  • ashishlohraashishlohra Posts: 1
    NerveGear
    edited September 2018
    @raeldor and @imperativity:

    I am trying to load personalized avatars on my Oculus Go, and I am following the documentation over here: https://developer.oculus.com/documentation/avatarsdk/latest/concepts/avatars-gsg-unity-mobile/
    (Unity Developer Guide - Mobile)
    I was able to successfully configure the Unity Editor (steps 1 - 7, including enabling the core Oculus APIs, the Platform, and Avatar APIs.)

    Question #1: I am not sure if I follow how to get the device ID for my Oculus Go on Step #8 (" ... (Only required for Gear VR development.) Create an Oculus Signature File for your Android device at https://dashboard.oculus.com/tools/osig-generator/ and then copy it to the folder gearvr-avatar/Assets/Plugins/Android/assets."). 

    For the above step, I simply got the Oculus sig. file using the device ID on my Oculus Go (underneath the strap), and created the above folder (Assets/Plugins/Android/assets) into the project window inside my Unity Editor. Anyway, I successfully added the VR Camera as well as Avatar in the following steps, and was able to build and run the .apk on my Oculus Go; the default blue avatar tracked head movements really well and the controller was tracking too.

    Question #2: I got stuck on 
    replacing the default blue avatar with a personalized Avatar using the Oculus Platform package.

    I was able to follow steps 1 - 6 under "Loading Personalized Avatars" documentation, but after step 6, I failed to make the "My Avatar" field appear in the Inspector for the empty game object created in my scene, and got the following error:

    - "error CS0029: Cannot implicitly convert type 'ulong' to 'string'"
    (for this piece of code: myAvatar.oculusUserID = message.Data.ID;)

    Would appreciate some background/advice on next steps for Question #1 and #2 above please.

    Thanks.
Sign In or Register to comment.