# Raycasting URDFRobot & URDFLink objects

**URL:** <https://discourse.threejs.org/t/raycasting-urdfrobot-urdflink-objects/30534>\
**Category:** Questions\
**Tags:** raycasting, raycaster\
**Created:** [October 5, 2021, 2:39pm UTC](https://discourse.threejs.org/t/raycasting-urdfrobot-urdflink-objects/30534 "2021-10-05T14:39:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ugurkoysuren](https://avatars.discourse-cdn.com/v4/letter/u/7ab992/32.png) [@ugurkoysuren](https://discourse.threejs.org/u/ugurkoysuren)\
**Post date:** [October 5, 2021, 2:39pm UTC](https://discourse.threejs.org/t/raycasting-urdfrobot-urdflink-objects/30534/1 "2021-10-05T14:39:43Z")

</div>

Hello everyone,

I’m currently raycasting objects, which works perfectly for Meshes. But doesn’t work for URDFRobot objects.

URDFRobots are actually child classes from Object3D, therefore I assumed that it will also work for them but no success so far.  
I use the [urdf-loader - npm](https://www.npmjs.com/package/urdf-loader) to load the URDF Objects, therefore I’m not sure if the threejs discourse forum is the right place to ask this question.

```javascript
    const intersects = this.raycaster.intersectObjects(this.scene.children);
    if (intersects.length > 0) {
      if (this.INTERSECTEDONCLICK.value != intersects[0].object) {
        this.transformControls.detach()
        this.INTERSECTEDONCLICK.next(intersects[0].object);
        this.transformControls.attach(this.INTERSECTEDONCLICK.value)
      }
    } 

```

I’m sure the URDFRobot is on the “this.scene.children” list. But so far no luck intersecting the URDFRobot.

any ideas?

I couldn’t create a fiddle I spend couple of hours creating a working jsfiddle, but did not succeed either, since I couldn’t use the URDFLoader from the external library using CDN.

---

<div class="post-metadata">

**Author:** ![gkjohnson](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/gkjohnson/32/2298_2.png) [@gkjohnson](https://discourse.threejs.org/u/gkjohnson)\
**Post date:** [October 6, 2021, 3:28am UTC](https://discourse.threejs.org/t/raycasting-urdfrobot-urdflink-objects/30534/2 "2021-10-06T03:28:22Z")

</div>

The URDF Loader classes support raycasting but without a working example it’s hard to help. Which version of three.js are you using?

> I couldn’t create a fiddle I spend couple of hours creating a working jsfiddle, but did not succeed either, since I couldn’t use the URDFLoader from the external library using CDN.

The library should work just fine via [unpkg.com](http://unpkg.com) or skypack.dev to convert the bare module imports. There’s also a [UMD variant](https://unpkg.com/urdf-loader@0.10.2/umd/URDFLoader.js) available on unpkg, as well, if you’re not using module imports.

---

<div class="post-metadata">

**Author:** ![ugurkoysuren](https://avatars.discourse-cdn.com/v4/letter/u/7ab992/32.png) [@ugurkoysuren](https://discourse.threejs.org/u/ugurkoysuren)\
**Post date:** [October 27, 2021, 2:55pm UTC](https://discourse.threejs.org/t/raycasting-urdfrobot-urdflink-objects/30534/3 "2021-10-27T14:55:33Z")

</div>

> [@gkjohnson](#):
>
> v

Hi Garrett,

I tried creating my first fiddle but was not able to make it run the URDFLoader, therefore I was not able to create a full example.

> **[\[bug\] three.js volumetric rendering onto fullscreen quad with perspective...](https://jsfiddle.net/ugurkoysuren/xLnrkb79/2/)**
>
> Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.

What am I missing?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![gkjohnson](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/gkjohnson/32/2298_2.png) [@gkjohnson](https://discourse.threejs.org/u/gkjohnson)\
**Post date:** [October 28, 2021, 1:01am UTC](https://discourse.threejs.org/t/raycasting-urdfrobot-urdflink-objects/30534/4 "2021-10-28T01:01:58Z")

</div>

If you open up the console you can see what the issues are. It looks like you’re loading URDFLoader multiple times? And the URDF you’re loading requires ColladaLoader so that must be included on the page.
