Moon Posted June 5, 2014 Share Posted June 5, 2014 Hello,I hope you are all well today. I have this simple question... When we instanciate an object, it should have its name as an ID, but what if we use a loop for example ? Where does the ID source its value, then ? Thank you. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 5, 2014 Share Posted June 5, 2014 Not sure to understand your question Quote Link to comment Share on other sites More sharing options...
Moon Posted June 5, 2014 Author Share Posted June 5, 2014 Sorry its my fault, I had a feeling that it wasn't very clear. I meant, Where does a Mesh for example source its ID value when we its instaciated within a loop for example ? Like in:for(var i = 0; i < 10; i++){mesh[i] = new BABYLON.Mesh.CreatePlane("MyPlane", 1, scene, false);}//I'm asking this because the ID is usually meant to be a unique identificator, whereas the default in Babylon is to take the value of the name as an ID, but in a case like the one above, I wanted to know where does it source its ID. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 5, 2014 Share Posted June 5, 2014 for(var i = 0; i < 10; i++){mesh[i] = new BABYLON.Mesh.CreatePlane("MyPlane" + i, 1, scene, false);}This code should be good for your need Quote Link to comment Share on other sites More sharing options...
Moon Posted June 5, 2014 Author Share Posted June 5, 2014 I know that just wondered what does Babylon in a case like the one I have written. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 5, 2014 Share Posted June 5, 2014 Oh sorry there is no security mechanism. All objects will have the same id Quote Link to comment Share on other sites More sharing options...
Moon Posted June 5, 2014 Author Share Posted June 5, 2014 Okay, thank you. 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.