Should see a double-click (Primary mouse button, often Left) click on the sphere verses the player. I changed to OnDoublePickTrigger for both meshes. The animated player does not show the alert(), nor the console.log() message. Am I missing something or is this a defect?
Thanks.
// compared click for sphere
var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 0.2, scene);
sphere.position.x = 2;
sphere.actionManager = new BABYLON.ActionManager(scene);
sphere.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnDoublePickTrigger, function () {
alert('sphere clicked');
console.log("OnDoublePickTrigger worked!");
}));
This code chunk does not:
// click action for player
player.actionManager = new BABYLON.ActionManager(scene);
player.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnDoublePickTrigger, function () {
alert('player clicked');
console.log("OnDoublePickTrigger worked!");
}));
Test sample: