Raytracing says "object.layers is undefined"

Hello once again,

when I change the raytracer from

var intersects = raycaster.intersectObject( scene, true );
( which yields results )


var intersects = raycaster.intersectObject( objectsarray, true );

I get this error- message “object.layers is undefined”.
The objectsarray- array is populated at the same time the object is added to the scene.

scene.add( object );
objectsarray.push( object );

var intersects = raycaster.intersectObject( scene.children, true );
gets the same error.

Please, telle me what I am doing wrong.

The objects I would like to be seperately raycasted are animated Mixamo characters.

See first argument of .intersectObject vs first argument of .intersectObjects :point_left:

1 Like

Thank you THAT very, very much.
That’s something I could have overlooked for weeks.
I like you, you are somewhat usefull.

And THaNK YoU VErY MUCH again…!!