Gizmo axis not being triggered

Hello everyone, I’m trying to display to the user the amount of drag after a gizmo axis drag movement, and created a function to treat all of three gizmos at once to not repeat myself (It was working when I created separatedly). The function sets observables to the three gizmos but only display information about the last axis informed (in this case ‘z’).

Here follows the playground (Line 39):
https://playground.babylonjs.com/#F5QZVD#10

Let me take a look

g.axis is a reference to the axis string. you have to do a copy of that string or it will be overriden in next loop iteration.

Gizmo axis title not displaying | Babylon.js Playground (babylonjs.com)

1 Like

Thanks, it worked! :grinning:

Another problem, now rotation axis only shows angles of z rotation plane gizmo. Any idea why?

Line 55
https://playground.babylonjs.com/#F5QZVD#19

Am I missing something fundamental about javascript?

same issue. g is overriden each iteration. you need to make a copy like this:

Gizmo axis title not displaying | Babylon.js Playground (babylonjs.com)

1 Like

It worked, thanks again! Is it a thing specific to javascript? Because it makes no sense at all. g is supposed to be a reference to the object, at least in Java it works that way.

1 Like