georage Posted July 31, 2016 Share Posted July 31, 2016 Hello, I am probably doing this all wrong, but I need a "get mesh by name" function. I understand there is some sort of built in function for this, but I cannot find out how to use it. I created this function, which I thought would return the mesh, but it doesn't. (I assign m.name during creation of all meshes, and this function does accurately report finding the mesh) function getMeshByName(meshName, scene){ scene.meshes.forEach(function(m) { if(m.name == meshName) { console.log("found mesh " + m); return m; } }); } how do I make "m" return the actual mesh? Or how do I do this using the existing functions? Thanks for any help! Quote Link to comment Share on other sites More sharing options...
georage Posted July 31, 2016 Author Share Posted July 31, 2016 Never mind! I found the existing function! Sorry for the litter. function getMeshByName(mName, scene){ return scene.getMeshByName(mName); } GameMonetize and Wingnut 2 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.