Some hints are shared here: Please Read This Before Posting a Question
For your specific question:
- A minimal working & debuggable example is always welcome, because most bugs (besides the most obvious), can be found only by debugging. Without such example you put additional load on people who want to help, as they have to make a working example, which often requires setting up some custom assets. And sometimes the issue is some incompaibility between the code and the structure of the assets,
- Using “thanks in advance” is a huge turn-off for me and maybe others. More details why it is so, are here: Never end your email with “Thanks in advance” and Thanks in advance? No thank you
- As for making hovered meshes reddish and reverting their color when the hover is over, a simpler approach is to keep the mesh colors as they are. Instead hovering only changes the intensity of a red emissive color. Here is a demo with a GLTF tractor with several submeshes (look at lines 65-66 and from line 94 to the end): https://codepen.io/boytchev/pen/Baqraaa
- As for your approach of managing colors, without knowing the structure of your models it is hard to guess. The problem might be in the following code (your models might have nested meshes, so the topmost objects are not meshes, but groups; and groups have no materials, so revertColor does nothing):
function onMouseMove(event) {
:
// Revert color if not intersecting with any object
Object.values(scene.children).forEach(mesh => {
revertColor(mesh);
});
}