Search code examples
javascriptreactjstypescriptmeshbabylonjs

Fire event when mesh position updated in Babylon.JS


I have a react app, and when I type in a text box it updates the position of a mesh inside a BabylonJS canvas. I need to be able to do this in reverse - update the text box when a gizmo is used to move the mesh. I don't know if this is possible with an event or another way.

Any help would be highly appreciated.


Solution

  • You can use onDragObservable for instance Doc: https://doc.babylonjs.com/how_to/gizmo