I am currently working on rendering a 3D model of a house using Three.js and encountering an issue with the raycaster in my code. The problem I'm facing is that it's selecting every object both behind and in front of the specific object I want to select. What I actually need is for it to return just the name of the selected object. Any guidance or assistance on this matter would be greatly appreciated. As of now, I am only logging the name of the selected object to the console.
function main() {
// Function body here
}