# Does / should scene.getTransformNodeByName() have meshes returned

**URL:** <https://forum.babylonjs.com/t/does-should-scene-gettransformnodebyname-have-meshes-returned/31987>\
**Category:** Questions\
**Created:** [July 7, 2022, 12:58pm UTC](https://forum.babylonjs.com/t/does-should-scene-gettransformnodebyname-have-meshes-returned/31987 "2022-07-07T12:58:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [July 7, 2022, 12:58pm UTC](https://forum.babylonjs.com/t/does-should-scene-gettransformnodebyname-have-meshes-returned/31987/1 "2022-07-07T12:58:53Z")

</div>

Am trying to supply an XR feature, `WebXRAnchorSystem`, with an option of type `TransformNode`. A Mesh inherits from `TransformNode`, so in theory `getTransformNodeByName()` would find a mesh if the name were passed.

I am in doubt that would happen though. Thought I would get an explicit answer, rather than scrape an answer based on a reading of source code. `TransformNode` got added for GLB files, & that is not my strongest area.

---

<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:** [July 7, 2022, 3:10pm UTC](https://forum.babylonjs.com/t/does-should-scene-gettransformnodebyname-have-meshes-returned/31987/2 "2022-07-07T15:10:02Z")

</div>

Would `scene.getNodeByName()` suit your needs?

---

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [July 7, 2022, 3:16pm UTC](https://forum.babylonjs.com/t/does-should-scene-gettransformnodebyname-have-meshes-returned/31987/3 "2022-07-07T15:16:09Z")

</div>

I saw that right above getTransformNodeByName(). It would work, though maybe all Nodes are not TransformNode.

This is not so much a technical question, as what is intended with this set of getters coverage wise?

---

<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:** [July 7, 2022, 3:52pm UTC](https://forum.babylonjs.com/t/does-should-scene-gettransformnodebyname-have-meshes-returned/31987/4 "2022-07-07T15:52:51Z")

</div>

Looking at the code, the only places that call `addTransformNode` are the TransformNode constructor itself and the AssetContainer. And by this example, `getTransformNode` by name will indeed only return this class, not its subclasses like Mesh: [getTransformNodeByName | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#WWGSXB)

---

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [July 7, 2022, 4:35pm UTC](https://forum.babylonjs.com/t/does-should-scene-gettransformnodebyname-have-meshes-returned/31987/5 "2022-07-07T16:35:52Z")

</div>

Thanks guys for looking at this. When TransformNodes came to be, they set the look up rules, but did not take the subclasses into account.

I am writing deployment configuration code. Do not want to have to mess around going back for scope issues. I’ll just write / steal my own, which takes the widest knowable case. It is not that much to do.
