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.
World anchors in hierarchies

I am curious about a few things about world anchors. When you are dealing with a hierarchy of objects, what are the best practices for assigning world anchors?
If a place a world anchor on the parent object, does every other object in the hierarchy will be locked too?
If the first question is not true, should I place world anchors on individual child objects in addition to the one on the parent?
Am I able to transform any of the child objects freely because they don't have a world anchor directly assigned to them?
I have an anchor on the parent object. What happens if I'm dealing with animations only on the child objects? Will the objects be unable to move?
I know that in order to move an anchored object I need to remove the anchor first and place it again after it is in the new position. Is this true for the entire hierarchy as well?
Thanks in advance.
Best Answers
-
Reeley ✭✭✭
Yes, the transform of the children is dependent of the transform of the parent, basically your child transform is locked too because it calculates the position depending on the parent.
Yes.
As long as you dont touch the transform of the parent with the WorldAnchor this works.
Yes if you want to change the transform of an object the WorldAnchor has to be deleted. I would recomend to destroy with DestroyImmediate() so the WorldAnchor is destroyed immediatley and not just flaged to be destroyed.
7 -
stepan_stulov ✭✭✭
Very good answer, @Reeley
I can maybe add a bit of philosophy to this. Each object's transform is controlled by one of the paradigms at a time, with more paradigms being mixed in causing a great deal of trouble due to them each "thinking" as an authority of itself: manual/scripting changes, physics, animation, tracking (world anchors). It's generally advised to have only one of these paradigms controlling an object's transform at a time since they're mutually exclusive both conceptually and technically. If you add a world anchor, you don't touch the object's position/rotation, and you don't allow an animation or physics to control it either, you give up control to the tracking system. If it's physics, then so be it, but then no animation and scripting control only in physics language (forces & torques) and also no tracking. If you absolutely need to involve multiple paradigms in parallel, you usually make a whole chain of containers where only one paradigm controls one container.
For example you have a world-anchored arena on your floor, wherein an arena-nested character with a rigidbody and a collider is jumping around with physics, wherein a character-nested rig is animated with an animator to reflect the movement state of the character, where in rig-nested containers receive their armor plates swapped by code.
You can also come up with more advanced techniques where you for example world-anchor some path nodes whereby the character, not being anchored herself, gets her position interpolated from the nodes. You can get very creative.
Hope this adds to the answers.
Building the future of holographic navigation. We're hiring.
6
Answers
Yes, the transform of the children is dependent of the transform of the parent, basically your child transform is locked too because it calculates the position depending on the parent.
Yes.
As long as you dont touch the transform of the parent with the WorldAnchor this works.
Yes if you want to change the transform of an object the WorldAnchor has to be deleted. I would recomend to destroy with DestroyImmediate() so the WorldAnchor is destroyed immediatley and not just flaged to be destroyed.
Very good answer, @Reeley
I can maybe add a bit of philosophy to this. Each object's transform is controlled by one of the paradigms at a time, with more paradigms being mixed in causing a great deal of trouble due to them each "thinking" as an authority of itself: manual/scripting changes, physics, animation, tracking (world anchors). It's generally advised to have only one of these paradigms controlling an object's transform at a time since they're mutually exclusive both conceptually and technically. If you add a world anchor, you don't touch the object's position/rotation, and you don't allow an animation or physics to control it either, you give up control to the tracking system. If it's physics, then so be it, but then no animation and scripting control only in physics language (forces & torques) and also no tracking. If you absolutely need to involve multiple paradigms in parallel, you usually make a whole chain of containers where only one paradigm controls one container.
For example you have a world-anchored arena on your floor, wherein an arena-nested character with a rigidbody and a collider is jumping around with physics, wherein a character-nested rig is animated with an animator to reflect the movement state of the character, where in rig-nested containers receive their armor plates swapped by code.
You can also come up with more advanced techniques where you for example world-anchor some path nodes whereby the character, not being anchored herself, gets her position interpolated from the nodes. You can get very creative.
Hope this adds to the answers.
Building the future of holographic navigation. We're hiring.
Both answers are pretty concise and definitely complement each other. Thanks guys!