Emiya0306 Posted April 6, 2018 Share Posted April 6, 2018 Hey everyone! Here is another demo to show that I failed to create the instance from mesh. Is something I missing? Please give me a hand, thanks! Quote Link to comment Share on other sites More sharing options...
MarianG Posted April 6, 2018 Share Posted April 6, 2018 Hi @Emiya0306. Your file contains 2 meshes, the first mesh is an empty mesh and it's parent of the second mesh. Because of this line 17 container.meshes[0].isVisible = false; doesn't work. I mean it's working, but using this you hide only the first mesh. If you want to hide a mesh and its childs you have to use container.meshes[0].setEnabled(false); This hide the first mesh and the second mesh which is child. About createInstance function, you have the same problem. CreateInstance works only for "curent" mesh, it doesn't instantiate parents or childs only curent mesh. So it works on your case too, but because the mesh you instantiate is an empty mesh you cann't see the result. So if you want to instantiate your object you have to instantiate your second mesh from container. And your pg Quote Link to comment Share on other sites More sharing options...
Emiya0306 Posted April 8, 2018 Author Share Posted April 8, 2018 Hey @MarianG. 1. Got it, setEnabled(false) is cool! Thanks! 2. CreateInstance for the second mesh, it works. But you can see the scaling of the model has already been changed as well. It is not the parent mesh you can see which scaling is Vector3(1, 1, 1), it becomes other value. The same for rotate and position. So how to deal with this 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.