XR Interaction Toolkit and Mirror

Hi everyone!

I’m trying to implement a VR multiplayer game using Mirror. The players spawns correctly and I can translate them with the keys, but when I try moving the hands, I am not only moving the local player’s hand, I am moving all player’s. I dont know why this is happening, I guess that it is because of the XR Interaction Toolkit, because without it (no moving hands) it works correctly.

Also, I don’t know if this is importat, bus I am using MockHMD for the tests.

Does somebody know why this is happening?

PD: Sorry if something is not write correctly.

Well, i don’t use mirror but MLAPI. but i had that problem. in MLAPI we have something that is “Islocalplayer” which checks if the player is local or not

1 Like

In Mirror we also have that variable, but I am not sure how to prove if the hands are moving or no. I’ll try testing if I move a GameObject this information is shared with all players, because the problem can just be with MockHMD.

NetworkTranform will handle it for you. (It did for me)

1 Like

I’m trying different stuff, I hope something works xD. I’ll read more about NetworkTransform, thank you.

It works only when the host moves, not with the rest of the clients. I think that I have to change something, I’m looking at it.

Connected with the team and they are wondering - do you have the script which moves the hands based on the simulator on all of the hands in the scene, including those that are being replicated across the network? That may be setting the wrong value.

Has anyone found a fix for this yet? I get some nasty errors telling me my Oculus Quest 2 controllers are not found. I’ve tried reinstalling all the packages, and that seems to clear up the warnings in the console, but the issue remains the same. I am able to look around through the headset just fine, but otherwise, my hands are not moving at all. This only started happening when I imported the mirror asset and started using it. I can’t even get a newly created XR rig to work, let alone the one I already made(That was working just fine, to begin with). Just to be clear this happens as soon as I start in play mode, with or without mirror being used. I am very confused about what is causing the issue right now. The only thing I can caulk it up to is mirror or the XR toolkit (It’s most likely mirror since I haven’t, had an issue with past versions that don’t have mirror implemented).

the issue you are experiancing can be solved by disabling xr/vr rig as whole gameobject on nonlocal players. what i did i made a new script and made like this

if (!isLocalPlayer)
        {
            xrRig.SetActive(false);
        }

        if (isLocalPlayer)
        {
            xrRig.SetActive(true);
        }

if in game you are making you need to see other player hands movements, in theory you could simply disable all scripts related to vr instead of whole gameobject and on hands it self put a network transform.

1 Like