Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Shared Player and motion Controller positions

I'm attempting to created a shared scene where i can see other peoples position & rotation Along with controller position and rotation.

I have a player prefab with a head and two hands. I should see the remote players head and controllers as they move around.

I want to see my hands prefab over the top of my own controllers too.

The player prefab follows the mixed reality camera parent correctly.
Any ides what I'm doing wrong here?

 [SyncVar]
    private Vector3 localPosition;
    [SyncVar]
    private Quaternion localRotation;
    [SyncVar]
    private Vector3 remoteRightControllerPostion;
    [SyncVar]
    private Vector3 remoteLeftControllerPostion;
    [SyncVar]
    private Quaternion remoteRightControllerRotation;
    [SyncVar]
    private Quaternion remoteLeftControllerRotation;



    // Update is called once per frame
    void Update()
    {

        if (!isLocalPlayer)
        {
            rightHand.transform.localRotation = remoteRightControllerRotation;
            leftHand.transform.localRotation = remoteLeftControllerRotation;
            rightHand.transform.localPosition = remoteRightControllerPostion;
            leftHand.transform.localPosition = remoteLeftControllerPostion;
            return;
        }

        remoteLeftControllerRotation = UnityEngine.XR.InputTracking.GetLocalRotation(UnityEngine.XR.XRNode.LeftHand);
        remoteRightControllerRotation = UnityEngine.XR.InputTracking.GetLocalRotation(UnityEngine.XR.XRNode.RightHand);

        remoteRightControllerPostion = transform.TransformPoint(UnityEngine.XR.InputTracking.GetLocalPosition(UnityEngine.XR.XRNode.RightHand));
        remoteLeftControllerPostion = transform.TransformPoint(UnityEngine.XR.InputTracking.GetLocalPosition(UnityEngine.XR.XRNode.LeftHand));

        rightHand.transform.rotation = remoteRightControllerRotation;
        leftHand.transform.rotation = remoteLeftControllerRotation;
        rightHand.transform.position = remoteRightControllerPostion;
        leftHand.transform.position = remoteLeftControllerPostion;

        head.transform.rotation = CameraCache.Main.transform.rotation;
        transform.position = CameraCache.Main.transform.position;
        CmdTransform(CameraCache.Main.transform.position, CameraCache.Main.transform.rotation,  leftHand.transform.rotation, rightHand.transform.rotation, rightHand.transform.localPosition, leftHand.transform.localPosition);
    }


    /// Sets the localPosition and localRotation on clients.
    /// </summary>
    /// <param name="postion">the localPosition to set</param>
    /// <param name="rotation">the localRotation to set</param>
    [Command(channel = 1)]
    public void CmdTransform(Vector3 postion, Quaternion rotation, Quaternion rightHandRotation, Quaternion leftHandRotation, Vector3 rightControllerPostion, Vector3 leftControllerPostion)
    {

        localPosition = postion;
        localRotation = rotation;
        remoteRightControllerRotation = rightHandRotation;
        remoteLeftControllerRotation = leftHandRotation;
        remoteLeftControllerPostion = leftControllerPostion;
        remoteRightControllerPostion = rightControllerPostion;
    }![](https://us.v-cdn.net/6026774/uploads/editor/xo/xjmtiu29euyi.png "")

Sign In or Register to comment.