How to reposition Tube After Creation?

If I create a Tube like this:

const tube = BABYLON.MeshBuilder.CreateTube(“tube”, {path: [start, end], radius: 0.5}, scene);

How can I then change the path array in the options?

This means I want to set new values for start and end after the tube was created.

Normally on another mesh I would do mesh.position. What is the equivalent here since I need to control 2 vectors?

I think I found what I need here Dynamically morph a mesh - Babylon.js Documentation

Probably easier using the instance parameter https://www.babylonjs-playground.com/#165IV6#845

Uncomment line 27

2 Likes

Yes it wouldn’t work without this parameter. It would be great if it was more obvious that this is required in the documentation I linked above.

Fortunately I was able to figure this out on my own.

https://doc.babylonjs.com/how_to/parametric_shapes#instance

https://doc.babylonjs.com/how_to/parametric_shapes#tube

Thanks I scrolled to the Tube section without reading anything else.