Jump to content

Tag Issue


freetoplay
 Share

Recommended Posts

Hi, I am getting an error when I try to loop through checking for tags.

In my code, I have:

 let oldMesh = scene.meshes;
                    for (let i=1; i < oldMesh.length; i++) {
                        BABYLON.Tags.EnableFor(oldMesh[i]);
                    }
                    oldMesh[3].addTags("test");

Inside my importMesh function, I have:

BABYLON.SceneLoader.ImportMesh(null, "/assets/", "test.glb", scene, function (meshes, particleSystems, skeletons) {
                       meshes[0].position.y += 1;

                        for (let i=1; i < oldMesh.length; i++) {
                            console.log(oldMesh[i]); // this works fine
                            console.log(oldMesh[i].hasTags()); // this throws an error
                        }
               
                   });

 

Does anyone know know why the hasTags function is throwing an error in the loop?

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...