Jump to content

Mesh instance Question


Emiya0306
 Share

Recommended Posts

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 :) 

Link to comment
Share on other sites

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? :P

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...