I want to use raycaster
component in <a-cursor>
entity to intersect some
cubes.
I set the objects
property like '#box' (my cube's id), but the cursor still
intersects all element.
I step into the raycaster source code, and the data.objects
is ''
.
So, I wonder if I set the property in a wrong way?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There was a bug in A-Frame with dependency components. It's been fixed in the Dev Builds: https://github.com/aframevr/aframe/tree/master/dist#dev-builds and will be released with 0.4.0.
A workaround is to put the raycaster component before the cursor:
<a-entity raycaster="..." cursor="..."></a-entity>