Hello,
I’m trying to learn PlayCanvas, I’ve already experimented with three.js a few things (3D furniture configurator) and found that was easy.
But I can’t do the same with PlayCanvas (I’m not coding expert, just enthusiastic one )
What I want to do : hiding some child elements of my model.
What I’ve done : (googled and have read a thousand of articles, the API reference also and tried a lot of options without success)
- I’ve loaded my dae file in the editor
- Then added the JSON file to my scene
- My dae file has group of elements (doors, drawers, etc)
- So I want to hide some child elements from my model and then making them visible by clicking on a button.
I just need to understand the PlayCanvas coding logic… and this seems to be easy but…
For the moment I have this code :
AccessSubmodel.prototype.initialize = function() {
var e = this.app.root.findByName("Model");
var m = e.findByName("_5_DRAWERS");
m.enabled = false;
console.log(e);
console.log(m);
};
In the console I see my Entity “Model” and my GraphNode “_5_DRAWERS”
But the drawers are still visible…
Can someone be kind to explain or give me an example what kind of code do I need to use for accessing my sub-elements and manipulating them?
I think this will be a good start for me to understand how.
Thank you.