# Instances should only created for meshes with geometry

**URL:** <https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873>\
**Category:** Questions\
**Tags:** instances, glb\
**Created:** [February 2, 2023, 5:32pm UTC](https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873 "2023-02-02T17:32:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Takemura](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/takemura/32/25836_2.png) [@Takemura](https://forum.babylonjs.com/u/Takemura)\
**Post date:** [February 2, 2023, 5:32pm UTC](https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873/1 "2023-02-02T17:32:52Z")

</div>

Yo all,

I suddenly started to get this warning (topic title) since ~2-3 days. Did anything changed on instantiateModelsToScene? It occurs on all my .glb-files, while like 4 days ago everything worked without any warning spamming. Since then I tested CannonJS, AmmoJS and ended at RecastJS formy project. Also what I recognized is that the getClassName()-function returns “InstancedMesh” instead of “Mesh”, is this new?

Here my repro (PG):

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

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [February 2, 2023, 6:11pm UTC](https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873/2 "2023-02-02T18:11:32Z")

</div>

It’s a bug in this PR when using **instantiateModelsToScene**  
I forgot to tag people so unsure if they were notified.  
@carolhmj @sebavan

> <https://github.com/BabylonJS/Babylon.js/pull/13467#issuecomment-1413176032>
>
> I think this broke something when using AssetContainer.instantiateModelsToScene(…)
> Started getting spammed with logger messages "Instances should only be created for meshes with geometry."
> 
> All meshes and rootNodes(probably the logger cause) added by \*instantiateModelsToScene\* now tagged as "isAnInstance" when running the following code in console
> 
> scene.meshes.forEach( (mesh) =\> {
> console.error(mesh.name, mesh.isAnInstance)
> })
> 
> and animations can no longer be played separately,
> 
> check console (might need to hard reload), should show the logger message spam, the heads are also supposed to move/animate independently of each other (delayed), check the 4.2.1 bjs version as reference
> https://playground.babylonjs.com/#S7E00P

---

<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:** [February 2, 2023, 6:33pm UTC](https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873/3 "2023-02-02T18:33:00Z")

</div>

Oh, I didn’t see this. Taking a look now.

---

<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:** [February 2, 2023, 6:47pm UTC](https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873/4 "2023-02-02T18:47:11Z")

</div>

Apologies for this, a fix is on [Fix conditions for clone vs instance in AssetContainer.instantiateHie… by carolhmj · Pull Request #13496 · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/pull/13496)

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [February 2, 2023, 7:11pm UTC](https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873/5 "2023-02-02T19:11:22Z")

</div>

That was fast! 🙂

> **[Babylon.js Playground](https://playground.babylonjs.com/?snapshot=refs%2Fpull%2F13496%2Fmerge#S7E00P)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

looks good!

---

<div class="post-metadata">

**Author:** ![Takemura](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/takemura/32/25836_2.png) [@Takemura](https://forum.babylonjs.com/u/Takemura)\
**Post date:** [February 3, 2023, 10:01pm UTC](https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873/6 "2023-02-03T22:01:57Z")

</div>

There is still one thing, that isn’t like in the past. My `instance.rootNodes[0].rotationQuaternion` is undefined even though it is a .glb-file. Usually the **root** of .glb does use rotationQuaternion.

---

<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:** [February 6, 2023, 11:07am UTC](https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873/7 "2023-02-06T11:07:37Z")

</div>

Does that happen in the PG you showed earlier? I tried logging the rotationQuaternion, but the result is the same on 4.2 and the current version, both are null: [Warning Instances only geometry | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#3W9YXQ#1)

---

<div class="post-metadata">

**Author:** ![Takemura](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/takemura/32/25836_2.png) [@Takemura](https://forum.babylonjs.com/u/Takemura)\
**Post date:** [February 6, 2023, 6:03pm UTC](https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873/8 "2023-02-06T18:03:07Z")

</div>

Oh my bad, it is null not undefined. Seems strange because I didn’t had the error: `instance.rootNodes[0].rotationQuaternion is null` before.

---

<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:** [February 6, 2023, 7:03pm UTC](https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873/9 "2023-02-06T19:03:51Z")

</div>

Hmmm do you have any playground where the rotationQuaternion is different?

---

<div class="post-metadata">

**Author:** ![Takemura](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/takemura/32/25836_2.png) [@Takemura](https://forum.babylonjs.com/u/Takemura)\
**Post date:** [February 6, 2023, 7:36pm UTC](https://forum.babylonjs.com/t/instances-should-only-created-for-meshes-with-geometry/37873/10 "2023-02-06T19:36:59Z")

</div>

True, in all my PGs i do either use absoluteRotationQuaternion and/or reassign rotationQuaternion or used physicsMesh or collisionMesh and copyFrom. Since I moved from using physics- and collisionMesh, I will get it by absoluteRotationQuaternion and reassign instead of copyFrom.
