# Using of scene.pick

**URL:** <https://community.cesium.com/t/using-of-scene-pick/19788>\
**Category:** CesiumJS\
**Created:** [August 1, 2022, 3:19pm UTC](https://community.cesium.com/t/using-of-scene-pick/19788 "2022-08-01T15:19:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![theuns](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/theuns/32/3476_2.png) [@theuns](https://community.cesium.com/u/theuns)\
**Post date:** [August 1, 2022, 3:19pm UTC](https://community.cesium.com/t/using-of-scene-pick/19788/1 "2022-08-01T15:19:27Z")

</div>

HI  
I have to following code.

```auto
viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(movement) {
            // Pick a new feature
            var pickedFeature = viewer.scene.pick(movement.endPosition);
            if (!Cesium.defined(pickedFeature)) {
                console.log("No picked feature");
                return;
            }

           console.log(pickedFeature.primitive.id);
}

```

The output of `console.log(pickedFeature.primitive.id);` is `object Object`

How do I know what is type of instance is the pickedFeature, is it a Cesium.Entity, Cesium.Billboard?  
I have bilboards and polylines, that was created from code and some was loaded via a czml file.

Please help, I would ike to log out some of the properties of picked features, and later on display it.

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [August 7, 2022, 12:30am UTC](https://community.cesium.com/t/using-of-scene-pick/19788/2 "2022-08-07T00:30:20Z")

</div>

The [documentation of `Scene#pick`](https://cesium.com/learn/cesiumjs/ref-doc/Scene.html#pick) remains a bit vague here - and to some extent, this is intentional: There are many possible types of objects that may appear in the scene.

When you mention the console output that just says `[object Object]`, then this refers to the built-in console of the Sandcastle. But you can receive more detailed information in the console of the browser. You can look at this console in the “Developer Tools” of the browser. These tools can be opened through the menu, but in Chrome or Firefox you can just hit the `F12` key.

Here is an example of the Sandcastle console at the top, and the browser developer tools console at the bottom, showing the result of `console.log(pickedFeature.primitive);` in an example where a `Billboard` is picked:

 ![Cesium Console](https://global.discourse-cdn.com/cesium/original/2X/5/5e40ac1cb4fecd9ce78e0e4f590d79eb0bd4f300.png)

You can see that you’ll receive detailed information about the _type_ of the picked object, and even browse through its structure or properties.

Depending on _which_ objects you want to pick, you can check the type using `instanceof`. This can be done like this:

```auto
const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction(function (movement) {
  const pickedFeature = viewer.scene.pick(movement.endPosition);
  if (!Cesium.defined(pickedFeature)) {
    console.log("No picked feature");
    return;
  }
  console.log(pickedFeature.primitive);
  if (pickedFeature.primitive instanceof Cesium.Billboard) {
    console.log("That's a billboard");
  } else if (pickedFeature.primitive instanceof Cesium.Primitive) {
    console.log("That's a generic primitive (maybe from a CZML)");
  }
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);

```

(An aside: I usually try to avoid the use of `instanceof`. But in this case, there is no way around that: You simply do not know the types of _all_ the objects that _may_ appear in the scene, so you have to check for the type explicitly…)
