nahu Posted November 22, 2017 Share Posted November 22, 2017 Hello, I am trying to do a "OnPickTrigger" on a mesh after load with no success...no error in console but nothing happen // The first parameter can be used to specify which mesh to import. Here we import all meshes BABYLON.SceneLoader.ImportMesh("", "http://localhost/babylon/", "axonometrie.babylon", scene, function (newMeshes) { // Set the target of the camera to the first imported mesh //camera.target = newMeshes[0]; // alert(newMeshes[0].name); //show the name "test" newMeshes[0].scaling = new BABYLON.Vector3(0.1, 0.1, 0.1); // newMeshes[0].rotation = new BABYLON.Vector3(0, 0, 0); newMeshes[0].position = new BABYLON.Vector3(0, 0, 0); rdc = scene.getMeshByName("rdc"); alert(rdc); rdv_deux = newMeshes[2]; rdc.material = greenMat; //rdv_deux.material = greenMat; rdc.actionManager = new BABYLON.ActionManager(scene); var action = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, rdc, "visibility", 0, 200); rdc.actionManager.registerAction(action); }); thanks Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 22, 2017 Share Posted November 22, 2017 Hi Nahu, welcome to the forum. Please ensure that rdc.isPickable = true; That could be the problem. Report results, please. (thx) RaananW and nahu 2 Quote Link to comment Share on other sites More sharing options...
nahu Posted November 22, 2017 Author Share Posted November 22, 2017 Thanks Wingut. Perfect quick answer. Thanks Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.