Hi I noticed that if I have a mesh which can be intersected by raycaster and if I have an material array, which one of is null- while raycasting i receive Error: three.module.js:11410 Uncaught TypeError: Cannot read property ‘morphTargets’ of null. But If I have a mesh with material array with nulls, but this mesh is not a part of raycasting it works well. Should I understand this- if I have a mesh and it would be affected by raycasting- none of its material can be null?
I am asking this because sometimes I do not need to apply material to the bottom side of box- it would not be visible anyway for a user- and for better performacne I usually put null.
Example: Box that has no bottom material.
const materials = [new MeshBasicMaterial(),new MeshBasicMaterial(),,new MeshBasicMaterial(),null,new MeshBasicMaterial(),new MeshBasicMaterial()]
const mesh = new THREE.Mesh(g,materials);