Dreik Posted June 12, 2018 Share Posted June 12, 2018 So I am working on cube view and I've encountered problem I can't solve. If you look at the screen I'm creating 4 arrows on GUI, these are created on Plane that is attached to camera watching the cube. The problem is if plane is pickable I can't press on cube. But If plane is unpickable these arrows (buttons) aren't pickable. So I'd like to make them pickable but trun off plane pickability. Is that possible? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 12, 2018 Share Posted June 12, 2018 Everything is possible can you repro in the Playground? Quote Link to comment Share on other sites More sharing options...
Dreik Posted June 13, 2018 Author Share Posted June 13, 2018 Not really. The code is quite vast. All I can do is provide you with the setup of gui and mesh. And as you can see you can press button but can't press cube. https://www.babylonjs-playground.com/#UHSQB9 Quote Link to comment Share on other sites More sharing options...
Dreik Posted June 13, 2018 Author Share Posted June 13, 2018 I've just encountered another problem. If I have 2 cameras with set layers and I push them to scene only one camera will handle the picking. So If I push camera that watches the cube 1st then I can interact only with plane that is attached to camera or cube. If I push another camera 1st I can interact only with objects visible in this camera and buttons that I places on the plane attached to camera watching cube aren't dispatching any events. Quote Link to comment Share on other sites More sharing options...
Dreik Posted June 13, 2018 Author Share Posted June 13, 2018 If you look at this https://www.babylonjs-playground.com/#UHSQB9#3 you can see that you can press only on object that are visible in camera that is at index 1 of scene.activeCameras. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 13, 2018 Share Posted June 13, 2018 Hello, you cannot pick the cube because the plane is over: https://www.babylonjs-playground.com/#UHSQB9#4 Quote Link to comment Share on other sites More sharing options...
Guest Posted June 13, 2018 Share Posted June 13, 2018 For the two cameras questions, you can only have one activeCamera for picking per scene. You can change it with scene.cameraToUseForPointers Quote Link to comment Share on other sites More sharing options...
Arte Posted June 13, 2018 Share Posted June 13, 2018 @Dreik You have 2 viewports (camera.viewport and cameraTwo.viewport). On mouse over viewport2: scene.cameraToUseForPointers=cameraTwo; scene.activeCamera=cameraTwo; On mouse out viewport2: scene.cameraToUseForPointers=camera; scene.activeCamera=camera; GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Dreik Posted June 14, 2018 Author Share Posted June 14, 2018 I understand these. @Deltakosh I know that the plane is over. My question is can I somehow ignore the plane and pick cube without ignoring button too? Quote Link to comment Share on other sites More sharing options...
Dreik Posted June 14, 2018 Author Share Posted June 14, 2018 So ultimately I've went with slightly worse idea. I created 2 engines and 2 canvas overlaying. It works great now. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 14, 2018 Share Posted June 14, 2018 you can't ignore the plane because it is used to make the projected UI work 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.