jsdream Posted April 22, 2017 Share Posted April 22, 2017 Hi everyone! I'm building an infinite runner and exporting predefined blocks from Blender. In BJS I create instances of those block meshes exported from Blender and place them dynamically to create pathway for a character. So my aim is to use exported meshes as `blueprint` for instances creation. What's the best way to hide a mesh exported from Blender and use it only as a reference to create instances of the mesh to place them dynamically? Currently I'm just placing base meshes outside the skybox mesh to hide them and then create instances of those base meshes and place the instances inside skybox mesh where I need them to be. Although that works I'm just wondering is there any better/proper way to hide base meshes? Quote Link to comment Share on other sites More sharing options...
jsdream Posted April 24, 2017 Author Share Posted April 24, 2017 I just actually realized I can use isVisible property on a mesh to hide it instead of moving it outside of skybox. But I'm still open to suggestions if there is even more better way of handling the scenario described above ;-) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 24, 2017 Share Posted April 24, 2017 Even better: mesh.setEnabled(false) which removes the mesh from the entire graph jsdream 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 25, 2017 Share Posted April 25, 2017 Hunh, I did not know that. Cool! Thx DK. I thought SURE... setting instanceMaster.setEnabled(false)... would be "handed-along" to instances. https://www.babylonjs-playground.com/#1AFQPV#6 Nope, DK is correct, as usual. Fascinating. Property .visibility is a "live update" thing, but not .isEnabled(). Very good. jsdream and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
jsdream Posted April 25, 2017 Author Share Posted April 25, 2017 Thank you Deltakosh! I knew there must be an even better way and you gave it to me ;-) Wingnut thanks for bringing .visibility property to my attention. I guess I can use it to achieve fade in and fade out animation effects :-) 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.