# setAbsolutePosition after parenting

**URL:** <https://forum.babylonjs.com/t/setabsoluteposition-after-parenting/14920>\
**Category:** Questions\
**Created:** [October 14, 2020, 4:12pm UTC](https://forum.babylonjs.com/t/setabsoluteposition-after-parenting/14920 "2020-10-14T16:12:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![boudinot](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/boudinot/32/11657_2.png) [@boudinot](https://forum.babylonjs.com/u/boudinot)\
**Post date:** [October 14, 2020, 4:12pm UTC](https://forum.babylonjs.com/t/setabsoluteposition-after-parenting/14920/1 "2020-10-14T16:12:57Z")

</div>

Hello here !

I do not understand what is going on here?  
[https://playground.babylonjs.com/#AZIGC1#1](https://playground.babylonjs.com/#AZIGC1#1)

If someone can explain to me why the spheres are not at the same position?  
What if I reverse lines 27 and 28 it works ??

Thank you!

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [October 14, 2020, 5:53pm UTC](https://forum.babylonjs.com/t/setabsoluteposition-after-parenting/14920/2 "2020-10-14T17:53:28Z")

</div>

Hello and welcome!  
This is because the setAbsolutePosition is not triggering the matrix computation  
This is done by line #30 here:  
[https://playground.babylonjs.com/#AZIGC1#2](https://playground.babylonjs.com/#AZIGC1#2)

---

<div class="post-metadata">

**Author:** ![boudinot](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/boudinot/32/11657_2.png) [@boudinot](https://forum.babylonjs.com/u/boudinot)\
**Post date:** [October 15, 2020, 9:10am UTC](https://forum.babylonjs.com/t/setabsoluteposition-after-parenting/14920/3 "2020-10-15T09:10:44Z")

</div>

Okay! Thanks for answering!  
I understand well!  
So why is it not done automatically?

And so, after the fact, I was wondering what was the right behavior if the hierarchy was deeper? Should the computeWorldMatrix be applied across the entire chain?  
Example:  
[https://playground.babylonjs.com/#AZIGC1#4](https://playground.babylonjs.com/#AZIGC1#4)  
I have commented on lines that are not useful … In fact, one in two works … and vice versa  
Is this normal?

Thanks again to you and have a nice day!

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [October 15, 2020, 11:46am UTC](https://forum.babylonjs.com/t/setabsoluteposition-after-parenting/14920/4 "2020-10-15T11:46:04Z")

</div>

> [@boudinot](#):
>
> So why is it not done automatically?

As far as I understand it, and I am no expert, it is done automatically but during the rendering phase not the interpretation phase.

> **[Babylon.js Playground](https://playground.babylonjs.com/#AZIGC1%235)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

using _computeWorldMatrix_ forces when the calculation is done.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [October 15, 2020, 3:42pm UTC](https://forum.babylonjs.com/t/setabsoluteposition-after-parenting/14920/5 "2020-10-15T15:42:49Z")

</div>

@JohnK is right. It will be done during the next frame rendering  
We try to reduce all expensive operations. Computing matrices is one of them.
