Skip to main content

Event

Provided to event callbacks such as onHoverEnter, onHoverLeave, onPointerDown and onPointerUp with information about the event.

function Box() {
return (
<box onPointerDown={e => console.log(e.avatar)}>
)
}

Props

PropTypeDescription
typeStringhover-enter, hover-leave, pointer-down or pointer-up
avatarUidStringUID of the avatar that produced the event
avatarAvatarThe avatar that produced the event
handStringThe hand that produced the event. null when not in VR
originVector3The origin of the raycast in world space
directionVector3The direction of the raycast in world space
hitObjectThe entity that was hit (if any)
hit.entityUidStringThe UID of the entity
hit.pointVector3The position of the hit in world space
hit.normalVector3The The normal of the hit, in world space
hit.distanceNumberThe distance from origin to the hit point
hit.meshNameStringThe name of the mesh, if any
hit.nodeIdStringThe ID prop of the node/element
hit.instanceIdNumberThe index of an individual <boxes/> or <spheres/> item
hit.isAvatarBooleanWhether the entity hit is an avatar

Notes

None