I’m trying to change the opacity and make it transparent in meshPhongMaterial but its not working. But when I try it with meshStandardMaterial it is working fine. How can I do the same with meshPhongMaterial
This is the code I’m trying. All of the materials are in meshPhongMaterial
Object.keys(materials).forEach(function (prop) {
if (
prop.includes("_352") ||
prop.includes("_353") ||
prop.includes("_354") ||
prop.includes("_355") ||
prop.includes("_356") ||
prop.includes("_357") ||
prop.includes("_358") ||
prop.includes("_359") ||
prop.includes("_360") ||
prop.includes("_361") ||
prop.includes("_362") ||
prop.includes("_363") ||
prop.includes("_351")
) {
gsap.to(materials[prop], {
duration: 1.5,
opacity: 0.2,
transparent: true,
});
materials[prop].color.setRGB(0, 0, 1);
}
});