I have some problems in my project that are making my project frozen.
I know there are many questions but I would get pleased if someone could help me
1) Is it possible to access a model hierarchy? I know that by code I can access them, but I need to disable some of them also, and maybe changing their particular materials.
2) Is it possible to move colliders when a model animation is being executed? Imported animations and models doest not get colliders animated when running.
3) Does PlayCanvas have a way to make scene transitions? Or do I need to remove all items in the scene manually and then load the new scene entities to root?
4) I am not able to add words containing accents in HTML files. Once my target language is portuguese, I really need to have accents is these files. If I try to save something with accent, I get this error: “Error while saving: ‘ascii’ codec can’t encode character XXX in position XXX: ordinal not in range(128)”.
5) Once the project is getting big, is there a way to organize things in folders?
6) Internet sometimes is not so good here. So, is there a way I can host PlayCanvas fully offline, including the Editor?
Models have an array of mesh instances (pc.MeshInstance). There isn’t an official way to disable/hide an individual mesh instance, but this should work:
function disableMeshInstance(meshInstance) {
var index = app.scene.drawCalls.indexOf(meshInstance);
if (index !== -1) {
app.scene.drawCalls.splice(index, 1);
}
}
To change the material, just do:
meshInstance.material = myMaterial;
You would only be able to do this in script, programatically creating entities with collision components and adding them as children of whatever nodes in the model’s hierarchy you want.