Hi there, another day of work…one step forward, one back.
I hope you can help. I’m having a problem with a position gizmo using the gizmo manager Here is my playground. If you click on the upper part, you will see a spherical mesh stick to it. The problem is that the axis arrows aren’t appearing. They used to when the code below was used, but the problem was that the axis arrows appeared on other meshes too. I would like only the top roofTop mesh to have the position Gizmo.
From the documentation, if you use the Gizmo Manager, you can specify what mesh to attach the gizmo to. The nonworking Gizmo code in my playground starts at line 113.
Below - is the old code I had used but was adding the Gizmo to unwanted meshes:
var gizmoManager = new BABYLON.GizmoManager(scene);
gizmoManager.positionGizmoEnabled = true;
//*** ENTER (mesh) to attach to model
gizmoManager.attachToMesh(device);
This technique using the GizmoManager is interesting and simple to use.
I had a go at using this method. Unfortunately, it was really the green spherical objects (Dev2) that I wanted the gizmo attached to, so I tried attaching the Gizmo to them using your described method. I have the Dev2 objects appearing again in my playground below but using your method the Gizmo isn’t attaching. I obviously must be doing something wrong…do you have any ideas?
You can keep the attachableMeshes for picking but force another to be attached with onPointerUp happens. Only roomtop meshes are selectable but you can move the cloned sphere once 1 is selected.
Sorry to be a nuisance…is there a way using this method so that if an earlier sphere is selected again the Gizmo appears? As the spheres may need to be adjusted slightly once placed. The code in my initial post seemed to do this (but was attaching the Gizmo to everything).