I only used Action Manager triggers via direct Mesh triggers (roll over, click):
var doit = function (mesh) {
mesh.actionManager
.registerAction(
new BABYLON.InterpolateValueAction(
BABYLON.ActionManager.OnPointerOutTrigger,
mesh,
‘visibility’,
1,
200
)
);
doit(mymodel);
I am looking to trigger the effect using a button click from an html block:
Another option, if you want to trigger an action that isn’t easily triggered by a simulated pointer action, is to call .processTrigger() on actionManager.
Here’s an example playground that shows an OnPointerOutTrigger running when the pointer leaves a mesh, as well as when the user clicks a GUI button:
Thanks, the example did not work. How would you trigger an effect like the fade below using a registered action?
var doit = function (mesh) {
mesh.actionManager.registerAction(
new BABYLON.InterpolateValueAction(
BABYLON.ActionManager.OnPointerOutTrigger,
mesh,
‘visibility’,
1,
200
)
);