I have a mesh that has a child mesh that I want to show/hide based on whether the mesh is hovered. So I add an action manager to the parent mesh. I also need an action manager on the child mesh to handle the click action. When I do this, hovering the child mesh will trigger the pointer out on the parent mesh which will trigger the child mesh to hide. See https://playground.babylonjs.com/#5EK9SZ#8. Basically what I need is the pointer out isn’t triggered if the pointer is still over a child mesh, even if the child mesh has it’s own action manager, but this does not appear to me current behavior. Using scene pointer observables would require me to keep track of the state that action manager already does for me, so this is not ideal for pointer over/out. I could use scene pointer observable for the child pick action, but is there a better way? Better meaning simpler logic.
I found isRecursive which causes the parent pointer out/over to trigger when the child pointer out/over occurs. What I want is the parent pointer out doesn’t happen at all if the pointer is over a child.
@PolygonalSun can you have a look ???
As your case sounds pretty custom, I guess coding the logic manually might be simpler ?
If you don’t want to use pointer observables you can add actions (with OnPointerOverTrigger & OnPointerOutTrigger) on child mesh aswell.
Is it though? I would think it would be a fairly common use case to have a UI element that appears when you hover over a mesh and disappears when you move the pointer off the mesh and have that UI element itself have an action manager. Here is the best solution I came up https://playground.babylonjs.com/#5EK9SZ#12. It involves registering nearly the same actions for enable and disable on both the icon and the mesh action managers. I say nearly the same because on disable you have to check whether you are over the icon in the mesh pointer out action and over the mesh in the icon pointer out action, though that aspect may be specific to my arrangement where the UI overlaps the mesh.
Expanding further, I think it is really pointer in and pointer out triggers that are impacted by this. I probably want to have an option to treat the child mesh, even though it has it’s own action manager as an extension of the parent for purposes of pointer out and in.
Hm, I think just passing the event from the parent manager to the child might have some unintended consequences. What is really needed here is to have some kind of OR condition on the action manager. This is not supported, but we have plans of reworking and expanding the action manager in the future, so we definitely should keep this in mind.