cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to keep hands from disappearing?

omtron
Protege
My unity 5.5. archery game requires steady hands, but the hands disappear after a couple of seconds if there is no hand movement. Is there a way to prevent this from happening or increase the time before they disappear?
1 ACCEPTED SOLUTION

Accepted Solutions

omtron
Protege
I found a solution.. I changed line 24 of OvrAvatarRenderComponent.cs from 

this.gameObject.SetActive(active);

to 

this.gameObject.SetActive(false);

Seems to work. Hopefully no negative side effects somewhere.

View solution in original post

5 REPLIES 5

omtron
Protege
I found a solution.. I changed line 24 of OvrAvatarRenderComponent.cs from 

this.gameObject.SetActive(active);

to 

this.gameObject.SetActive(false);

Seems to work. Hopefully no negative side effects somewhere.

tokai74
Honored Guest
Hello, I  have the sam problem. Tried to upgrade my project from unity 5.4 to unity 5.5. And now my hands disappear after some seconds without movement. Your workaround didn't work for me.
When i change the line to this.gameObject.SetActive(true), all avatar-items are visible (the controllers also)
Did you find another solution/workaround in the meantime?
I also tested it with unity 5.6 => same issue.

tokai74
Honored Guest
Ok, now I found another workaround/hack for my project, which shows the avatar-hands always even when they are not moved.
- Avatar-SDK 1.12.0
- Unity 5.5

I made changes in the following 2 Script-files marked as bold-text :


OvrAvatarSkinnedMeshRenderComponent.cs:
======================================

    internal void UpdateSkinnedMeshRender(OvrAvatar avatar, IntPtr renderPart)
    {
        ovrAvatarMaterialState materialState = CAPI.ovrAvatarSkinnedMeshRender_GetMaterialState(renderPart);
        ovrAvatarVisibilityFlags visibilityMask = CAPI.ovrAvatarSkinnedMeshRender_GetVisibilityMask(renderPart);
        if(renderPart == OvrAvatar.renderpartLeftHand || renderPart == OvrAvatar.renderpartRightHand) visibilityMask = ovrAvatarVisibilityFlags.FirstPerson | ovrAvatarVisibilityFlags.ThirdPerson | ovrAvatarVisibilityFlags.SelfOccluding;

OvrAvatar.cs: 
===========     

    public static IntPtr renderpartLeftHand= IntPtr.Zero;
    public static IntPtr renderpartRightHand= IntPtr.Zero;

    private void UpdateAvatarComponent(ovrAvatarComponent component)
    {
        OvrAvatarComponent ovrComponent;
        if (!trackedComponents.TryGetValue(component.name, out ovrComponent)) {
            throw new Exception(
                string.Format("trackedComponents didn't have {0}", component.name));
        }
        ConvertTransform(component.transform, ovrComponent.transform);
        for (UInt32 renderPartIndex = 0; renderPartIndex < component.renderPartCount; renderPartIndex++)
        {
            if (ovrComponent.RenderParts.Count <= renderPartIndex)
            {
                continue;
            }
            OvrAvatarRenderComponent renderComponent = ovrComponent.RenderParts[(int)renderPartIndex];
            IntPtr renderPart = GetRenderPart(component, renderPartIndex);
            if(renderpartLeftHand==IntPtr.Zero && renderComponent.name.StartsWith("hand_left")) renderpartLeftHand = renderPart;
            if(renderpartRightHand==IntPtr.Zero && renderComponent.name.StartsWith("hand_right")) renderpartRightHand = renderPart;       


Luis.Zan
Protege
This no longer works on the latest version of the Oculus SDK. Does anyone know how to fix this for newer versions of the SDK?

kagroe
Honored Guest


This no longer works on the latest version of the Oculus SDK. Does anyone know how to fix this for newer versions of the SDK?


In "Assets\Oculus\Avatar\Scripts\OvrAvatarLocalDriver.cs" search for "isActive", which you'll find two times, and set both to true.