I want to change the Opacity of a ThreeJS Mesh use react-three-Fiber.
const planeRef = useRef<Mesh>(null);
useFrame(() => {
if(planeRef.current) {
//@ts-ignore
planeRef.current.material.opacity += 0.1
}
})
return (
<mesh ref={planeRef}>
<Plane args={[5, 5]} position={[0, 0, -1]}>
<meshBasicMaterial attach="material" color="white" opacity={0} transparent={true}/>
</Plane>
</mesh>
However nothing happens. I dont understand why I cant access the mesh properties