I’ve got a box and I’ve set its options (width, height, facecolors…). Now I want to change the colors at a pickEvent, but I don’t know how to access them? is it even possible? Or are these options just used to build the mesh and thereafter useless?
https://www.babylonjs-playground.com/#ICZEXW#118
options (line 29)
var options = {
width: 10,
height: 3,
depth: 5,
faceColors: faceColors
};
pickEvent (line 42)
scene.onPointerDown = function (evt, pickResult) {
if (pickResult.hit) {
//box.options.faceColors[4] = 15; // doesnt work
// box.faceColors[4] = new BABYLON.Color4(255, 255, 255, 1); // doesnt work
// faceColors[4] = new BABYLON.Color4(255, 255, 255, 1);// doesnt work
console.log("HIT")
}
};