# Targeting camera to a certain part of an imported mesh

**URL:** <https://forum.babylonjs.com/t/targeting-camera-to-a-certain-part-of-an-imported-mesh/1037>\
**Category:** Questions\
**Created:** [January 29, 2019, 6:08pm UTC](https://forum.babylonjs.com/t/targeting-camera-to-a-certain-part-of-an-imported-mesh/1037 "2019-01-29T18:08:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Modos](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/modos/32/317_2.png) [@Modos](https://forum.babylonjs.com/u/Modos)\
**Post date:** [February 1, 2019, 4:10pm UTC](https://forum.babylonjs.com/t/targeting-camera-to-a-certain-part-of-an-imported-mesh/1037/5 "2019-02-01T16:10:47Z")

</div>

@trevordev

> [@trevordev](#):
>
> For skeletons, you can attach a mesh to the skeleton and look at that

Nice, it is mostly the same solution as the one in my other thread:

> [@Problem with infinite rays and position of raycast](https://forum.babylonjs.com/t/problem-with-infinite-rays-and-position-of-raycast/1036/2):
>
> You are generating a ray per frame in your castRay() function. This function creates an helper which in turn generate a mesh (per frame again). So no wonder why it is slow slight_smile Why are you generating a ray per frame? (scene.registerBeforeRender is called once a frame) You can create a dummy box, attach your box to the bone with mesh.attachToBone and then attach your ray to this dummy box

This worked also fine for me:

```auto
scene.onBeforeRenderObservable.add(()=>{
    camera2.position = newMeshes[0].position.add(new BABYLON.Vector3(0,10,0))
})

```

@timetocode  
Thank you for your explanations and ideas.  
I’m planing to make a FPS, so it is supposed to be a multiplayer game.  
You have a good point with moving the head with the camera, I didn’t think of that.

Apparently I can’t rotate a bone on its own.  
I tried:

```auto
botHead = skeleton.bones[4]
botHead.rotation.x = -2; // the same with x/z and other numbers 

```

But at least the whole mesh looks in the direction of the mouse now (still two dimensional)  
Even in first person.

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

---

_[View the full topic](https://forum.babylonjs.com/t/targeting-camera-to-a-certain-part-of-an-imported-mesh/1037)._
