# Meshes connected by lines?

**URL:** <https://forum.babylonjs.com/t/meshes-connected-by-lines/15176>\
**Category:** Questions\
**Tags:** gui\
**Created:** [October 26, 2020, 11:54am UTC](https://forum.babylonjs.com/t/meshes-connected-by-lines/15176 "2020-10-26T11:54:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![temail](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/temail/32/12668_2.png) [@temail](https://forum.babylonjs.com/u/temail)\
**Post date:** [October 26, 2020, 11:54am UTC](https://forum.babylonjs.com/t/meshes-connected-by-lines/15176/1 "2020-10-26T11:54:45Z")

</div>

Hello!

What’s the easiest way to connect two meshes with a line, and when moving one of the meshes, move the head of line which is relative to the selected mesh as well?

Playground demo: [https://www.babylonjs-playground.com/#LJ7TM5#5](https://www.babylonjs-playground.com/#LJ7TM5#5)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [October 26, 2020, 2:46pm UTC](https://forum.babylonjs.com/t/meshes-connected-by-lines/15176/2 "2020-10-26T14:46:15Z")

</div>

probably using lines and on every frame updating the lines ends to be in sync with the meshes positions ?

---

<div class="post-metadata">

**Author:** ![temail](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/temail/32/12668_2.png) [@temail](https://forum.babylonjs.com/u/temail)\
**Post date:** [October 26, 2020, 8:41pm UTC](https://forum.babylonjs.com/t/meshes-connected-by-lines/15176/3 "2020-10-26T20:41:11Z")

</div>

I am hoping for something easier. In my app I have over 10 meshes which must be connected via lines based on some patterns… code management will be a nightmare…

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [October 26, 2020, 9:25pm UTC](https://forum.babylonjs.com/t/meshes-connected-by-lines/15176/4 "2020-10-26T21:25:33Z")

</div>

Why ? you could definitely encapsulate the logic in a custom function/class/behavior ([Behaviors - Babylon.js Documentation](https://doc.babylonjs.com/features/behaviour)) to factorize it ?

---

<div class="post-metadata">

**Author:** ![MarianG](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mariang/32/138_2.png) [@MarianG](https://forum.babylonjs.com/u/MarianG)\
**Post date:** [October 27, 2020, 6:14am UTC](https://forum.babylonjs.com/t/meshes-connected-by-lines/15176/5 "2020-10-27T06:14:34Z")

</div>

[https://www.babylonjs-playground.com/#LJ7TM5#6](https://www.babylonjs-playground.com/#LJ7TM5#6)

---

<div class="post-metadata">

**Author:** ![temail](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/temail/32/12668_2.png) [@temail](https://forum.babylonjs.com/u/temail)\
**Post date:** [October 28, 2020, 2:51pm UTC](https://forum.babylonjs.com/t/meshes-connected-by-lines/15176/6 "2020-10-28T14:51:21Z")

</div>

Thank you all for your replies! I’ll take them one by one and study each case 😄
