How to set transform's node parent to camera when it has weird structure [PLAYGROUND LINK]

I got this animated pistol :

https://www.babylonjs-playground.com/#U8MEB0#93

I suspect it has something to do with its structure within the transform node.

I have done it with more simple meshes(non animated- but this is very nicely animated too.

The goal is to have the pistol in front you the camera’s view just like an FPS game.

1 Like

https://www.babylonjs-playground.com/#U8MEB0#95

You need to move the root at once.

1 Like

Well actually that was just for the playground my scene is bigger:

with Pistol2(the model in the playground) being a part of it and root containing everything so your way messes all the things.

You would need to split your exports to have separate trees or it might be really annoying to deal with :frowning:

1 Like

Hmm okay but I just started using blender to create my scenes and I don’t know if it’s possible to have them all both as separate exports and in the same blend file glb.

Don’t know how to explain better my problem :frowning:

Thanks though for the fast help !

Why not creating separate glbs ???

Else you will need to manually recreate a root transformNode with scaling 1 1 -1 put this as the parent of pistols and then put the new root under camera.

Interesting so…can I do it like this and the meshes go all in the same scene like this ?

assetsManager.addMeshTask(“task2”, “”, “…/assets/models/”, “ground.glb”);
assetsManager.addMeshTask(“task3”, “”, “…/assets/models/”, “pistol.glb”);
assetsManager.addMeshTask(“task4”, “”, “…/assets/models/”, “enemy1.glb”);

cause right now I load one big scene

assetsManager.addMeshTask(“task3”, “”, “…/assets/models/”, “scene.glb”);

Yup would definitely work