Action Manager Delete Mesh?

Hello everyone,

Is it possible to use action manager to delete a mesh? The code below works. However, instead of scaling the mesh, I need for it to be deleted.

    for (var i = 0; i < cloneArray.length; i++) {

    cloneArray[i].actionManager = new BABYLON.ActionManager(scene);
    foodArray.forEach((food) => {
        cloneArray[i].actionManager.registerAction(new BABYLON.SetValueAction({
                trigger: BABYLON.ActionManager.OnIntersectionEnterTrigger, parameter: food}, 
                cloneArray[i], "scaling", new BABYLON.Vector3(2, 2, 2)));

Solved :smiley: :+1:

I found a PG in a forum thread that demonstrates this:

1 Like