MinsuKim Posted June 28, 2018 Share Posted June 28, 2018 long time no see this forum i has one issue mesh.isPickable = false <<<< this code is not working below my code for (let currentIndex = 0; currentIndex < idx.mScene.meshes.length; currentIndex++) { idx.mScene.meshes[currentIndex].isPickable = pickable; }; but i don't understand..... why not working.... i'm already see other playground http://www.babylonjs-playground.com/#1C5IUC my code and there code different 1. my mesh in code var material2 = new BABYLON.StandardMaterial("material2", scene); let box = BABYLON.MeshBuilder.CreateBox(dynamicName, facOptions, scene); box.material = material2; 2. there code(play ground) var lineRed = BABYLON.MeshBuilder.CreateLines("red",{ points: [new BABYLON.Vector3(0, 1, 0), new BABYLON.Vector3(2, 1, 0)]}, scene); lineRed.color = BABYLON.Color3.Red(); lineRed.isPickable = false; my code and there code some different??? samething code in my eyes O_O...... please help me Quote Link to comment Share on other sites More sharing options...
Arte Posted June 28, 2018 Share Posted June 28, 2018 Hi @MinsuKim Everything is working as expected for me?! Can you create PG, so it will be easier to understand issue. MinsuKim 1 Quote Link to comment Share on other sites More sharing options...
MinsuKim Posted June 29, 2018 Author Share Posted June 29, 2018 @Arte i make the playground! https://playground.babylonjs.com/#ZLL01M box1.isPickable = true; box2.isPickable = false; box3.isPickable = false; but box2,box3 is pick! Quote Link to comment Share on other sites More sharing options...
brianzinn Posted June 29, 2018 Share Posted June 29, 2018 If you pass in a predicate then the isPickable is ignored: https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.scene.ts#L5406 I can think of 2 possible solutions. Either check in the predicate what you want to ignore (explicitly check isPickable): https://playground.babylonjs.com/#ZLL01M#1 or check after without a predicate - note along with mesh.isPickable that this also checks mesh.isEnabled() and mesh.isVisible: https://playground.babylonjs.com/#ZLL01M#2 Predicates are designed to allow us to override the default behaviour. ie: some people want to maybe include hidden meshes. Arte and MinsuKim 2 Quote Link to comment Share on other sites More sharing options...
MinsuKim Posted June 29, 2018 Author Share Posted June 29, 2018 @brianzinn Thank you for your help ! your my hero! your code is work! my mistake think explicitly process. ispickable param is only flag I hope people who have the same problem solve the problem. 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.