Dieterich Posted October 18, 2018 Share Posted October 18, 2018 When click in object, I want click in object encapsulated, for example: when click in sphere or box, both should be considered as my object 'master' This my example: http://www.babylonjs-playground.com/#Z1PG79#2 OBS: I don't know why showing this error in console: "Error: Active camera not set" Quote Link to comment Share on other sites More sharing options...
JohnK Posted October 18, 2018 Share Posted October 18, 2018 Not too sure what you want to happen on a click and also I am not getting and error messages. Perhaps the following are worth looking at http://doc.babylonjs.com/how_to/interactions https://www.babylonjs-playground.com/#7CBW04 Dieterich 1 Quote Link to comment Share on other sites More sharing options...
Dieterich Posted October 18, 2018 Author Share Posted October 18, 2018 Hi @JohnK. Well, when click both box or sphere, right? I want get the object in "extraInfo" in the "master" mesh, when clicked. As were a single object.. I know it would solve by accessing the parent, but I'd like to access directly in the master object. I refactor the code: http://www.babylonjs-playground.com/#Z1PG79#4 Quote Link to comment Share on other sites More sharing options...
MarianG Posted October 18, 2018 Share Posted October 18, 2018 maybe this? http://www.babylonjs-playground.com/#Z1PG79#5 Dieterich and JohnK 2 Quote Link to comment Share on other sites More sharing options...
Dieterich Posted October 18, 2018 Author Share Posted October 18, 2018 1 hour ago, Dieterich said: I know it would solve by accessing the parent, but I'd like to access directly in the master object. Hi @MarianG I mencioned this before, but I think it's a unique alternative... thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted October 18, 2018 Share Posted October 18, 2018 I guess MarianG solution is the more flexible here. You can also think about merging all meshes into one but I'm not sure this will work for you Dieterich 1 Quote Link to comment Share on other sites More sharing options...
Arte Posted October 18, 2018 Share Posted October 18, 2018 Another approach - Tags. http://www.babylonjs-playground.com/#Z1PG79#6 Dieterich 1 Quote Link to comment Share on other sites More sharing options...
Dieterich Posted October 19, 2018 Author Share Posted October 19, 2018 Hi @Arte This resource 'HasTags', I did not know. Very helpfull. I'm going to use parent even. Well, I go close the topic. Thanks a lot! Quote Link to comment Share on other sites More sharing options...
Arte Posted October 19, 2018 Share Posted October 19, 2018 Tags docs: https://doc.babylonjs.com/resources/tags Dieterich 1 Quote Link to comment Share on other sites More sharing options...
Dieterich Posted October 19, 2018 Author Share Posted October 19, 2018 Thanks @Arte Arte 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.