Want to ask about how to add interactivity to object #4039
-
so basically i try using this experiment by mr Robert Long https://github.com/mozilla/hubs/blob/a98d7a62516aa19f11e38f32d2d6683d09643a9a/doc/creating-networked-interactables.md and it work best and my problem basically arise when i try to add interaction to it this is my code : this is for hub.html i add this to be added later in the scene <template id="interactable-iframe-media">
<a-entity
class="interactable"
is-remote-hover-target
hoverable-visuals
tags="isHandCollisionTarget: true; offersHandConstraint: true; offersRemoteConstraint: true; inspectable: true;"
body-helper="type: dynamic; mass: 1; collisionFilterGroup: 1; collisionFilterMask: 31;"
matrix-auto-update
shape-helper="type: box"
set-unowned-body-kinematic
floaty-object="modifyGravityOnRelease: true; autoLockOnLoad: true; gravitySpeedLimit: 0; reduceAngularFloat: true;"
set-yxz-order
destroy-at-extreme-distances
matrix-auto-update
loader="loadedEvent: page-thumbnail-loaded"
>
</a-entity>
</template> then this is my aframe component i named it
as you can see i added |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@spiritbro1 Does it work if you add You should be able to add console logging to the Unmark this response as the answer if you are still running into problems you need help with. |
Beta Was this translation helpful? Give feedback.
@spiritbro1 Does it work if you add
singleActionButton: true
to yourtags
and changethis.el.addEventListener("interact", this.onClick)
tothis.el.object3D.addEventListener("interact", this.onClick)
?You should be able to add console logging to the
CursorTargettingSystem
,interaction
system andSingleActionButtonSystem
to trace through whether your object is available for raycasting, whether it's being hit by the raycaster, whether it'shovered
and finally whether theinteract
event will fire on itsobject3D
.Unmark this response as the answer if you are still running into problems you need help with.