fateriddle Posted October 24, 2018 Share Posted October 24, 2018 https://www.babylonjs-playground.com/#Y7XMAR#3 This pg. I try to copy 3 dragons with mesh.createInstance, but it doesn't work. However if you comment out line 16 and uncomment either line 14 (skull) or line 15 (tree), both work. Is it because dragon is a .gltf file and tree/skull are .babylon file? How do I work with .gltf files? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted October 24, 2018 Share Posted October 24, 2018 https://www.babylonjs-playground.com/#Y7XMAR#4 use clone ssaket 1 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 24, 2018 Share Posted October 24, 2018 CreateInstance does not support hierarchy, only the current mesh as explained in more detailed here: You might need to follow the same solution by creating instances for the entire tree or the art you d like (probably the mesh containing render data) and reparent them. http://www.babylonjs-playground.com/#ISZHF#3 Quote Link to comment Share on other sites More sharing options...
fateriddle Posted October 25, 2018 Author Share Posted October 25, 2018 16 hours ago, NasimiAsl said: https://www.babylonjs-playground.com/#Y7XMAR#4 use clone my questions followed: https://www.babylonjs-playground.com/#Y7XMAR#5 1. As shown in this PG, my goal is to show dragon one by one, walking towards you, so I used setInterval, is it a good way to do it and if not, any alternatives? 2. I can't seem to hide the original dragon, if I dispose it, nothing will be cloned, but if I just set its isVisible = false, doesn't work. 3. How do I play / stop the animation of the cloned dragons? I don't know where to find the animation instance to play. Quote Link to comment Share on other sites More sharing options...
bghgary Posted October 25, 2018 Share Posted October 25, 2018 setInterval works. You can also use promises and use Tools.DelayAsync, but I don't think that will be much easier. isVisible does not affect the children. You can use setEnabled(false) for this purpose. This one is trickier. I don't think there is a way to do this right now without walking the mesh hierarchy. I've filed an issue. 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.