# Interaction with imported models

**URL:** <https://forum.babylonjs.com/t/interaction-with-imported-models/690>\
**Category:** Questions\
**Tags:** documentation\
**Created:** [January 11, 2019, 11:41am UTC](https://forum.babylonjs.com/t/interaction-with-imported-models/690 "2019-01-11T11:41:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mixofo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mixofo/32/7947_2.png) [@mixofo](https://forum.babylonjs.com/u/mixofo)\
**Post date:** [January 11, 2019, 11:41am UTC](https://forum.babylonjs.com/t/interaction-with-imported-models/690/1 "2019-01-11T11:41:40Z")

</div>

Hello , i imported an .obj file to my Js file , but i dont know how to interacte with it , can someone help me please?

i use this code :

var abc = BABYLON.SceneLoader.Append("./", “3dmodel.obj”, scene, function (scene) { });

scene.registerBeforeRender(function () { abc.rotation.y += 0.01; });

Thanks

---

<div class="post-metadata">

**Author:** ![timetocode](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/timetocode/32/111_2.png) [@timetocode](https://forum.babylonjs.com/u/timetocode)\
**Post date:** [January 11, 2019, 12:29pm UTC](https://forum.babylonjs.com/t/interaction-with-imported-models/690/2 "2019-01-11T12:29:26Z")

</div>

To load with one mesh in specific, try the ImportMesh loader:

[https://www.babylonjs-playground.com/#JUKXQD#0](https://www.babylonjs-playground.com/#JUKXQD#0)

```javascript
    BABYLON.SceneLoader.ImportMesh("", "scenes/", "skull.babylon", scene, function (newMeshes) {
        // newMeshes[0] is the mesh to play with
        let skull = newMeshes[0];
        skull.position.x = 0.123456789
    });

```

Btw you can still play with the meshes with your current syntax. I haven’t used it, but my guess is that it’ll be in the scene.meshes array.

---

<div class="post-metadata">

**Author:** ![mixofo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mixofo/32/7947_2.png) [@mixofo](https://forum.babylonjs.com/u/mixofo)\
**Post date:** [January 11, 2019, 1:01pm UTC](https://forum.babylonjs.com/t/interaction-with-imported-models/690/3 "2019-01-11T13:01:20Z")

</div>

Thanks it is working !!

I have another question if it is possible , there is away to use the skull variable outside the BABYLON.SceneLoader.ImportMesh ? When i used it outside i have a console error : skull it is not defined .

---

<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:** [January 11, 2019, 5:14pm UTC](https://forum.babylonjs.com/t/interaction-with-imported-models/690/4 "2019-01-11T17:14:30Z")

</div>

it is possible but only if you wait for the load to be done. Loading a file is asynchronous so you cannot immediately use the mesh after calling ImportMesh (hence the callabck function)
