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

PlayerContoller.Instance calls not getting there?

Locally this works fine but when I deploy to the hololens it stops rotating. I never get anything back from the player controller.
Other commands are coming back from the player controller though. What am i missing here?

Thanks for the help.

   public void Rotate(int degrees)
        {
            Rotate(Quaternion.Euler(0, degrees, 0));
        }

        float lastRotateTime;

        public void Rotate(Quaternion rotation)
        {
            if (Time.time != lastRotateTime)
            {
                localRotation = rotation * localRotation;

              //It dies here.
                PlayerController.Instance.SendSharedTransform(gameObject, localPosition, localRotation);
                lastRotateTime = Time.time;
            }
        }

        public void Rotate90()
        {
            Rotate(90);
        }
        public void Rotate180()
        {
            Rotate(180);
        }

//I never get this called from the player controller
        [Command]
        public void CmdTransform(Vector3 postion, Quaternion rotation)
        {
            if (!isLocalPlayer)
            {
                localPosition = postion;
                localRotation = rotation;
            }
        }

       private void Update()
        {
                transform.localPosition = localPosition;
                transform.localRotation = localRotation;
        }

PlayerController

   public void SendSharedTransform(GameObject target, Vector3 pos, Quaternion rot)
        {
            if (isLocalPlayer)
            {
                CmdSendSharedTransform(target, pos, rot);
            }
        }
      [Command]
        private void CmdSendSharedTransform(GameObject target, Vector3 pos, Quaternion rot)
        {
            UNetSharedHologram ush = target.GetComponent<UNetSharedHologram>();
            ush.CmdTransform(pos, rot);
        }

Answers

Sign In or Register to comment.