Raycast weird intersection

Hello everyone,

I’m currently facing this weird behaviour when casting a ray.

As you can see on the image I’m clicking reasonably far from the planeGeometry / Line, but the result of the raycast says I’m clicking on the geometry.

Just so you guys know, I’m using React Three Fiber hook which gives me back some ‘entities’ necessary for the rayCast, below you can see the code:

const RayCaster = (): null => {
    const { raycaster, camera, mouse, scene } = useThree()

    if (pointerState === 1) {
        raycaster.setFromCamera( mouse, camera )
        const intersects = raycaster.intersectObjects (scene.children, true)
        const intersectable = getIntersectable(intersects)


        if (intersectable !== undefined) {
            console.log(intersectable)
            const posX = Math.floor(intersects[0].point.x)
            const posY = Math.floor(intersects[0].point.y)
            const posZ = Math.floor(intersects[0].point.z)

            console.log(`x: ${posX}, y: ${posY}, z: ${posZ}`)
        } else {
            console.log('no intersects')
        }

    }
    return null
}

and this is the function I’m using to check for specific intersected geometries:

function getIntersectable (entities: Object): ?Object {
    console.log(entities)
    for (let i = 0; i < entities.length; i++) {
        if (entities[i].object.parent && entities[i].object.parent.userData.intersectable == true) {
            return entities[i]
        }
    }
}

Any idea on what may be causing this weird offset?

Thanks