viewer.scene.globe.pick do not pick Cesium3DTileset's tile

var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction((movement) => {
  // var pickedPrimitive = viewer.scene.pick(movement.position);
  var ray =;
  var cartesian = viewer.scene.globe.pick(ray, viewer.scene);

  if (cartesian) {
          id: nombre.toFixed(2),
          position: cartesian,
          point : {
            pixelSize : 10,
            color : Cesium.Color.YELLOW
  } else {
      alert('Globe was not picked');
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);

I want to use the code to get the intersection of a ray and a Cesium3DTileset. But get the intersection of the ray and the background tarrein. How can i get what i want?

you can use PickPosition to pick the 3d position.

I need to use a ray to test intersetion, because pickPosition only support windowPosition.And sometimes the ray do not set from window.

We’re working on a feature to do this now, see #6080. In the meantime, here’s an example with a workaround.