Maximum call stack size error when using raycaster

hey everyone,

im using raycaster to cast a ray of two meshes, and when im calling intersectObject() method its give me the “Uncaught RangeError: Maximum call stack size exceeded” and the mesh struggling.

Can any one explaine this problem.


How complex is your scene? Is recursive set to true when performing the raycast? Any chance you can share your code and screenshot of the meshes.

thanks for ur reply,
in fact im working on a huge project, so a complex scene yeah, im not seting recursive on true. Hope its clear for you

Have you confirmed values for origin, EffOr and origin.distanceTo are reasonable and direction is pointing towards the mesh.

Default for intersectObject recursion is true. Have you tried explicitly setting to false?

If this is a loop of some sort you’re creating a new raycaster every call of this function, your raycaster only needs to be declared once then you can use intersects = raycaster.intersectsObjects()