I wrote my FPS controller and now I try to make a simple collision detect.
var b = new THREE.Vector3(0, 1, 0); function detectCollision() { scene.updateMatrixWorld(); raycaster.set(playerBody.position, b); var intersects = raycaster.intersectObjects(objects, true); if(intersects.length > 0) { intersects[0].object.material.color.set(0x000000); console.log('Yay!'); } } Reacts only to the line that I draw to check the correctness of the emitted beam. The reaction to the other objects was, but in a completely random place. I rummaged through the entire Internet yesterday, but did not understand what the problem was, please tell me what could be the matter.