Hey,
So I have tried all the different methods for raycasting that I could find (entity selection, hotspot, simple entity click) and all are giving me different issues. At this point I am unsure if it is a coding issue or if it has something to do with the way the scene is setup.
When I use the hotspot pc.Ray();
with intersectRay
, it hits all the entities at the same time and causes issues. The hotspot itself shows as a small portion in the editor, but the triggers seem to go outisde the bounds of the set radius. It also seems like they are “off”, ie. the stove triggers when clicked above it, the smarthub when behind the scene, etc.
When using the entity selection and the simple entity click raycastFirst()
, I have set the hotspots to have colliders, however only clicking the smarthub hotspot triggers anything and even then it seems off. The others will not trigger…except sometimes when the camera is positioned a certain way and click a bit away from the collider, it works. It all seems pretty random.
I have tried adding a lineRender, but it won’t persist in the scene, so I am unsure how to properly debug this thing.
I am using orbital controls, and currently the project is at a state where I am using the raycastFirst()
and attempting to log out the ray intersection, so only the SmartHub hotspot really works at all. We also forked the original repo from the Model Viewer project, if that matters.
I am able to revert to a more stable version where I am using intersectRay
instead and all hotspots get hit if that would be better to troubleshoot.
<Edit: Removed project link>
Any help would be greatly appreciated.