# LookAt for LineMesh does not work

**URL:** <https://forum.babylonjs.com/t/lookat-for-linemesh-does-not-work/29847>\
**Category:** Questions\
**Created:** [April 29, 2022, 9:40am UTC](https://forum.babylonjs.com/t/lookat-for-linemesh-does-not-work/29847 "2022-04-29T09:40:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TimT77](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@TimT77](https://forum.babylonjs.com/u/TimT77)\
**Post date:** [April 29, 2022, 9:40am UTC](https://forum.babylonjs.com/t/lookat-for-linemesh-does-not-work/29847/1 "2022-04-29T09:40:28Z")

</div>

Hi!

I wanna use “LookAt” for a LineMesh, but i does not work like for a Box (both MeshBuilder).

Am i wrong or is it a bug?  
PG: [https://playground.babylonjs.com/#Y7CS4N#212](https://playground.babylonjs.com/#Y7CS4N#212)

“linesystem” should “look” upwards (0, 1, 0) but it still looking forward…

Or any other idea how i can make this work?

Thx for your help!

Greets,  
Tim

---

<div class="post-metadata">

**Author:** ![syntheticmagus](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/syntheticmagus/32/395_2.png) [@syntheticmagus](https://forum.babylonjs.com/u/syntheticmagus)\
**Post date:** [April 29, 2022, 5:02pm UTC](https://forum.babylonjs.com/t/lookat-for-linemesh-does-not-work/29847/2 "2022-04-29T17:02:54Z")

</div>

Hi TimT77,

I think the issue is that your line mesh’s “facing” direction mathematically isn’t the same as the direction it intuitively looks like it should be facing based on its shape. If you comment out lines 67 and 71, you can see that with no rotation applied, the box’s long axis isn’t aligned with the camera shape’s “forward” axis. However, the long axis of the box _is_ aligned with Babylon’s notion of “forward” — the Z axis — whereas the camera shape is “facing” down -X, not Z. I can think of two straightforward ways to solve this. The better but slightly more difficult approach is to redraw the shape to match its intuitive “forward” axis with the Z axis (for every point in the shape, [`(x, y, z)` → `(-y, x, z)`](https://playground.babylonjs.com/#Y7CS4N#216)). The other, probably easier alternative is to just rotate the line mesh to be “facing” down Z, parent it to a `TransformNode` with no rotation on it, then [manipulate the `TransformNode` instead of the line mesh](https://playground.babylonjs.com/#Y7CS4N#217).

Hope this helps, and best of luck!

---

<div class="post-metadata">

**Author:** ![TimT77](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@TimT77](https://forum.babylonjs.com/u/TimT77)\
**Post date:** [May 2, 2022, 6:19am UTC](https://forum.babylonjs.com/t/lookat-for-linemesh-does-not-work/29847/3 "2022-05-02T06:19:49Z")

</div>

Hi Justin,  
thx a lot for you advice!

I’ve redrawn the line mesh regarding the intuitive “forward” axis:  
[https://playground.babylonjs.com/#Y7CS4N#218](https://playground.babylonjs.com/#Y7CS4N#218)

This helped! Thank you!

Greetings,  
Tim
