0

This my code in the Default.Html Page:

<button id="Remove_mesh" class="group">Remove</button>

And this my JS:

var pickResult = scene.pick(offsetX, offsetY);
if (pickResult.pickedMesh) {
 if ($('Remove_mesh').click(function(){}))
 {
    pickResult.dispose();
 }

This didn't work

Ethaan
  • 11,291
  • 5
  • 35
  • 45

1 Answers1

0

You should use: pickResult.pickedMesh.dispose()

$('Remove_mesh').on("click", function () {
    pickResult.pickedMesh.dispose();
});

More info: http://doc.babylonjs.com/page.php?p=24938

Jghorton14
  • 724
  • 1
  • 8
  • 25
David Catuhe
  • 1,747
  • 1
  • 10
  • 9