# Line drawn inside a rectangle that is linked with a mesh doesn't move with the mesh

**URL:** <https://forum.babylonjs.com/t/line-drawn-inside-a-rectangle-that-is-linked-with-a-mesh-doesnt-move-with-the-mesh/3285>\
**Category:** Questions\
**Created:** [May 17, 2019, 7:08am UTC](https://forum.babylonjs.com/t/line-drawn-inside-a-rectangle-that-is-linked-with-a-mesh-doesnt-move-with-the-mesh/3285 "2019-05-17T07:08:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DilshadRoshan](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@DilshadRoshan](https://forum.babylonjs.com/u/DilshadRoshan)\
**Post date:** [May 17, 2019, 7:08am UTC](https://forum.babylonjs.com/t/line-drawn-inside-a-rectangle-that-is-linked-with-a-mesh-doesnt-move-with-the-mesh/3285/1 "2019-05-17T07:08:28Z")

</div>

What I’m trying to do is to draw a line diagonally from top left corner to bottom right corner of a rectangle that is linked with a mesh.

This is how I tried: [Babylon.js Playground](https://playground.babylonjs.com/#MIKJQ8)

When the camera moves, the rectangle moves with the box but the line doesn’t. It appears fixed on the screen. How can I make it stuck to the rectangle?

---

<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:** [May 17, 2019, 5:33pm UTC](https://forum.babylonjs.com/t/line-drawn-inside-a-rectangle-that-is-linked-with-a-mesh-doesnt-move-with-the-mesh/3285/2 "2019-05-17T17:33:14Z")

</div>

Interesting…let me check 🙂

---

<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:** [May 17, 2019, 5:53pm UTC](https://forum.babylonjs.com/t/line-drawn-inside-a-rectangle-that-is-linked-with-a-mesh-doesnt-move-with-the-mesh/3285/3 "2019-05-17T17:53:55Z")

</div>

It will be fixed in next nightly!

Thanks a lot

---

<div class="post-metadata">

**Author:** ![DilshadRoshan](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@DilshadRoshan](https://forum.babylonjs.com/u/DilshadRoshan)\
**Post date:** [May 18, 2019, 8:33am UTC](https://forum.babylonjs.com/t/line-drawn-inside-a-rectangle-that-is-linked-with-a-mesh-doesnt-move-with-the-mesh/3285/4 "2019-05-18T08:33:26Z")

</div>

Happy to hear that 🙂

Thank you

---

<div class="post-metadata">

**Author:** ![Wingnut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/wingnut/32/53_2.png) [@Wingnut](https://forum.babylonjs.com/u/Wingnut)\
**Post date:** [May 18, 2019, 9:25am UTC](https://forum.babylonjs.com/t/line-drawn-inside-a-rectangle-that-is-linked-with-a-mesh-doesnt-move-with-the-mesh/3285/5 "2019-05-18T09:25:15Z")

</div>

Nice bug-find, DR. Thanks!

And thanks for the fix, DK!

---

<div class="post-metadata">

**Author:** ![DilshadRoshan](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@DilshadRoshan](https://forum.babylonjs.com/u/DilshadRoshan)\
**Post date:** [May 18, 2019, 11:02am UTC](https://forum.babylonjs.com/t/line-drawn-inside-a-rectangle-that-is-linked-with-a-mesh-doesnt-move-with-the-mesh/3285/6 "2019-05-18T11:02:43Z")

</div>

At first, I was not having realized that it’s a bug 😉

---

<div class="post-metadata">

**Author:** ![Wingnut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/wingnut/32/53_2.png) [@Wingnut](https://forum.babylonjs.com/u/Wingnut)\
**Post date:** [May 18, 2019, 12:05pm UTC](https://forum.babylonjs.com/t/line-drawn-inside-a-rectangle-that-is-linked-with-a-mesh-doesnt-move-with-the-mesh/3285/7 "2019-05-18T12:05:08Z")

</div>

Bugs are OFTEN that way. You did perfect. Check self/code first, read docs, create demo playground, and then ask others for info. (hi-5)

SUPER-programmers go further. They find where bug is located… inside GUI-feature source code, and then REALLY SUPER programmers fix the problem BEFORE Deltakosh, and with tighter code than Deltakosh would have used. This is not easy AT ALL, because DK is fast and thin-coding. 🙂
