Gizmo bug(Which scene owns this gizmo)

1.run the PG (4.2.1)
2.cut and paste the code (20~27)
from 20 to 103
3.click the “Play” button
4.you will see that,the gizmo’s position changed

Or ,you can run this version;
I set the gizmo belongs to scene,but it just show on scene2;
This is contrary to expectations

I’m taking a look.

I assigned the utility layer to the gizmo manager and it worked fine

also no need to create another engine with a new canvas, BJS can render multiple scene.
here I updated your code, hope it helps:

1 Like

thanks for your solution!
it is a better way for this requirement. :wink:

but i wonder ,why cause the result in my PG

1 Like

You’re welcome!

in the case of having multiple scenes, despite passing the proper scene when creating the gizmo, the default utility layer of the gizmo is created based on the last created scene, which will be the one to overlay the gizmos on top of.

that’s why I created a new utility layer to avoid this confusion, but I’m sure @Cedric will fix this unexpected behavior.

1 Like

That’s expected :

default utility layer uses the last created scene.
@MeshSlayer has found the good fix for that

1 Like

So, that means it’s not a bug, just a feature? :joy:

2 Likes

Yes! For once, it’s real :smiley:

1 Like