# Move imported mesh

**URL:** <https://forum.babylonjs.com/t/move-imported-mesh/1544>\
**Category:** Questions\
**Created:** [February 21, 2019, 9:58pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544 "2019-02-21T21:58:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 21, 2019, 9:58pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/1 "2019-02-21T21:58:24Z")

</div>

Hello.

When working on my game I have the fov of the camera zoomed in to “aim” the weapon. I also need to move the weapon in order to aim down iron sights. I have the weapon and the arms as a single .babylon file, and I have them as a child to a transform node. I am not able to change the position of the transform node after the model loads. It worked ONCE, but I changed the position of the transform node at the start and it stopped working. any help would be great.

Thanks, Givo.

PS: I am asking for help so much on these forums, I’m gonna credit the top 5 people who have helped me!😃

---

<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:** [February 21, 2019, 10:06pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/2 "2019-02-21T22:06:30Z")

</div>

We need a repro in the PG to help (as usual :))

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 21, 2019, 10:50pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/3 "2019-02-21T22:50:00Z")

</div>

I’ll try, but the playground doesn’t like my gitlab hosted models. Here is the link to the model: [viewmodeltest.babylon](https://gitlab.com/giv0/fpsg/raw/2dd8ceae07176125d6b8a8585b2d330ccffb1f72/assets/viewmodeltest.babylon)

Check out my website [giv0.gitlab.io/fpsg](http://giv0.gitlab.io/fpsg). The viewmodel looks good! Right click to “aim”!

---

<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:** [February 21, 2019, 11:01pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/4 "2019-02-21T23:01:28Z")

</div>

Well here is a doc for that:[Using External Assets - Babylon.js Documentation](https://doc.babylonjs.com/resources/external_pg_assets)  
It is clearly easier to help you if you can repro in the playground

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 21, 2019, 11:03pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/5 "2019-02-21T23:03:25Z")

</div>

I didn’t know about that. I’ll make the playground now 🙂

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 21, 2019, 11:07pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/6 "2019-02-21T23:07:46Z")

</div>

[Here](https://playground.babylonjs.com/#F26QNY)

I followed the steps but it didn’t show up ☹

---

<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:** [February 21, 2019, 11:36pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/7 "2019-02-21T23:36:51Z")

</div>

Well this link seems not to work  
[https://cdn.jsdelivr.net/gh/giv0/fpsg/raw/2dd8ceae07176125d6b8a8585b2d330ccffb1f72/assets/viewmodeltest.babylon](https://cdn.jsdelivr.net/gh/giv0/fpsg/raw/2dd8ceae07176125d6b8a8585b2d330ccffb1f72/assets/viewmodeltest.babylon)

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 21, 2019, 11:39pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/8 "2019-02-21T23:39:11Z")

</div>

hmmmmmmmmmmmmmmmmmmmmmmmmmmmmm…

could you try to modify the link? It was in my second post.

---

<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:** [February 21, 2019, 11:39pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/9 "2019-02-21T23:39:55Z")

</div>

Not sure to get what you want me to do 😃

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 21, 2019, 11:41pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/10 "2019-02-21T23:41:45Z")

</div>

In your second post, you had the link to the using external assets page. In MY second post, i had the model’s link. I modified it and you showed that it didn’t work. I was wondering if you could try to change the link to work in the playground. I’ll try again, though.

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 21, 2019, 11:42pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/11 "2019-02-21T23:42:50Z")

</div>

wait a minute. it uses gitHUB. I use gitLAB. I wonder if that has something to do with it not working.

---

<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:** [February 21, 2019, 11:43pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/12 "2019-02-21T23:43:31Z")

</div>

ok 🙂

I don’t know for gitlab to be honest. But if your problem is not related to the mesh directly maybe you can just recreate your problem with spheres and boxes

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 21, 2019, 11:44pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/13 "2019-02-21T23:44:35Z")

</div>

I can’t recreate it. The sphere works fine. I had it working ONCE but then I changed the value of the position and it stopped working.

I use gitlab because I like it’s web ide.

---

<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:** [February 21, 2019, 11:45pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/14 "2019-02-21T23:45:15Z")

</div>

ok so repro is mandatory 😃

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 21, 2019, 11:45pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/15 "2019-02-21T23:45:42Z")

</div>

Yes, I would say so too.

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 21, 2019, 11:46pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/16 "2019-02-21T23:46:13Z")

</div>

I could use the “dude” model to recreate it.

---

<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:** [February 21, 2019, 11:46pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/17 "2019-02-21T23:46:37Z")

</div>

good idea

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 21, 2019, 11:52pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/18 "2019-02-21T23:52:32Z")

</div>

TA DAA

[Here it is!](https://playground.babylonjs.com/#F26QNY#1) On right click, the camera zooms in. Dude should move down. he doesn’t. YAY a repro!

wait… why am I happy about an issue?

---

<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 22, 2019, 8:54am UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/19 "2019-02-22T08:54:28Z")

</div>

Hi @Givo You’re declaring " vmtp " inside the sceneloader success callback, but try to access/change it on pointer down/up (out of scope).

you should instead do something like this:

```
var vmtp;
BABYLON.SceneLoader.ImportMesh("him", "/scenes/Dude/", "Dude.babylon", scene, function(newMeshes) {
    vmtp = new BABYLON.TransformNode();
```

---

<div class="post-metadata">

**Author:** ![Givo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/givo/32/4968_2.png) [@Givo](https://forum.babylonjs.com/u/Givo)\
**Post date:** [February 22, 2019, 1:49pm UTC](https://forum.babylonjs.com/t/move-imported-mesh/1544/20 "2019-02-22T13:49:37Z")

</div>

Oh. I tried moving it outside, but not like that. I’ll try it. thanks!

[Next page](https://forum.babylonjs.com/t/move-imported-mesh/1544.md?page=2)
