c-frame / aframe-gltf-model-plus

gltf-model-plus component to load glb file with hubs extensions
https://c-frame.github.io/aframe-gltf-model-plus/
Mozilla Public License 2.0
10 stars 3 forks source link

move-to-unoccupied-waypoint on naf connected event #41

Closed vincentfretin closed 1 month ago

vincentfretin commented 1 month ago

I need a component move-to-unoccupied-waypoint that triggers on the naf connected event after a delay, that's a bit different from move-to-spawn-point. Use case is I have 20 seats in the scene, I click enter room, it shows a connecting screen for 3s so I have the waypoints isOccupied information from the other participants, then I get the first canBeOccupied waypoint in the scene and do waypoint.emit("click") and hide the connecting screen.

vincentfretin commented 1 month ago

After 3s delay on connected:

<a-entity
  id="rig"
  move-to-unoccupied-waypoint="on: connected; delay: 3"
></a-entity>

or on a plane on click (default)

<a-plane
  class="clickable"
  width="1.5"
  height="0.5"
  material="color:black"
  text="value: sit on a\nnearby seat; width: 4; align: center"
  position="-2.5 -3.5 -1"
  rotation="0 180 0"
  move-to-unoccupied-waypoint
></a-plane>