How to make an doubleclicktrigger(action manager) on a invisible mesh(isEnabled is false)

i have a ground when i double click on it isenabled trun to false and invisible i want to double click again on the same place (on the invisible ground) and make it visible again

new BABYLON.ExecuteCodeAction(
trigger: BABYLON.ActionManager.OnDoublePickTrigger,
function () {
ground1.setEnabled(ground1.isEnabled() ? false : true);
ground1.setEnabled(ground1.isEnabled() ? true : false);

You could drop the opacity to 0 or maybe try isVisible here ?

1 Like