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.

Placing an Object at a distance from and world anchor?

edited December 2017 in Projects

I am developing a HoloLens Application in Unity. I place an anchor vuforia (anchor1) and then i place objects in my scene using tap to place. I want to know first how to save that distance and second how to apply that distance to another game object (without using world anchors).
I am using this code to get the distance but the y axis is not working:
go.transform.position = new Vector3(parent.transform.position.x, parent.transform.position.y, parent.transform.position.z); -- to get the second object position;

UnityEngine.Vector3 rest = Position - zero; (zero is the anchor1 position)
Vector3 dir = rest.normalized;
float total_distance = dir.magnitude;
distance = zero + dir * total_distance; (final vecto3);

To load the new object i am using:
wa.transform.position + distance; (wa) is the new object;
Thanks for the help.

Sign In or Register to comment.