# How do I access the transformedPosition of objects?

**URL:** <https://forum.babylonjs.com/t/how-do-i-access-the-transformedposition-of-objects/28512>\
**Category:** Questions\
**Created:** [March 17, 2022, 5:45pm UTC](https://forum.babylonjs.com/t/how-do-i-access-the-transformedposition-of-objects/28512 "2022-03-17T17:45:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mpg/32/21248_2.png) [@mpg](https://forum.babylonjs.com/u/mpg)\
**Post date:** [March 17, 2022, 5:45pm UTC](https://forum.babylonjs.com/t/how-do-i-access-the-transformedposition-of-objects/28512/1 "2022-03-17T17:45:06Z")

</div>

I am trying to get the position of a light from a GLTF file so I can position a sphere created in Babylonjs in the same place.

The x, y, z position of the light are all 0 so I can’t use that.

The transformedPosition coordinates are correct and I can see them in chrome inspector, but when I console.log it, it comes out as undefined. I’m not sure why. How can I get those coordinates?

Thanks

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [March 17, 2022, 7:19pm UTC](https://forum.babylonjs.com/t/how-do-i-access-the-transformedposition-of-objects/28512/2 "2022-03-17T19:19:21Z")

</div>

Could you create a repro in the playground ? it sounds hard to help without it ?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 14, 2022, 10:38am UTC](https://forum.babylonjs.com/t/how-do-i-access-the-transformedposition-of-objects/28512/3 "2022-04-14T10:38:05Z")

</div>

Hello @mpg just checking in if you still have an issue and if so, if you can provide us with a [Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/) example so we can help further.

---

<div class="post-metadata">

**Author:** ![mpg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mpg/32/21248_2.png) [@mpg](https://forum.babylonjs.com/u/mpg)\
**Post date:** [April 16, 2022, 8:22pm UTC](https://forum.babylonjs.com/t/how-do-i-access-the-transformedposition-of-objects/28512/4 "2022-04-16T20:22:37Z")

</div>

Hello @carolhmj, @sebavan,

I am sorry for such a late reply. I got overwhelmed with stuff to do.

Here is an example of what I mean:

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

See the comments for my question and the screenshot for what Chrome inspector shows.

 ![Screenshot 2022-04-16 160748](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/8/4820a50dd395856faabe0c10236bb0ab2344b67d.png)

The problem was that I couldn’t access the xyz coordinates of the light from the gltf file.

I already found a solution to get the xyz, but there are things I don’t understand still. Please see the comments in the code.

Thanks

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [April 16, 2022, 9:11pm UTC](https://forum.babylonjs.com/t/how-do-i-access-the-transformedposition-of-objects/28512/5 "2022-04-16T21:11:18Z")

</div>

Seems that in your GLB model light position and light rotation are made with the help of TransformNode.  
You may check these lines at [https://playground.babylonjs.com/#R2B8EF#10](https://playground.babylonjs.com/#R2B8EF#10)

```auto

console.log(scene.getTransformNodeByName("Light").position)
console.log(scene.getTransformNodeByName("Light").rotationQuaternion)

```

Please note that there is also another TransformNode `Light_Orientation` which has rotation -90 degrees in X axis.

---

<div class="post-metadata">

**Author:** ![mpg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mpg/32/21248_2.png) [@mpg](https://forum.babylonjs.com/u/mpg)\
**Post date:** [April 17, 2022, 1:12am UTC](https://forum.babylonjs.com/t/how-do-i-access-the-transformedposition-of-objects/28512/6 "2022-04-17T01:12:43Z")

</div>

Thank you!
