Ahmet Gürbüz Posted July 22, 2017 Share Posted July 22, 2017 how can i get property of my variables? for example, I would like to get height, diameter value of var cone1 = BABYLON.MeshBuilder.CreateCylinder("cone1", { height: 1, diameter: 0.5, tessellation: 50 }, scene); I want to use value of height and diameter in following codes. thanks. Ahmet. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 24, 2017 Share Posted July 24, 2017 Unfortunately they are not saved. You may need to manually save it with cone1.options = ... Quote Link to comment Share on other sites More sharing options...
jerome Posted July 25, 2017 Share Posted July 25, 2017 or just create first your object options outside the create call : var coneProperties = {height: 10, diameterTop: 5, etc }; // you can access this one then var cone = BABYLON.MeshBuilder.CreateCylinder("cone", coneProperties, scene); NasimiAsl and Pryme8 2 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted July 25, 2017 Share Posted July 25, 2017 Id use a combination of Jerome and Deltas explanations: var coneOptions = { height: 1, diameter: 0.5, tessellation: 50 }; var cone1 = BABYLON.MeshBuilder.CreateCylinder("cone1", coneOptions, scene); cone1.options = coneOptions; the cone1 object can have what ever you want to store on it added after it is implemented. This is the same for any javascript Object as long as it does not overwrite something it wont ever break anything. 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.