A (VR-compatible) A-Frame scene with custom logic

This page contains a basic a-frame scene with custom logic. Custom logic in a-frame is implemented by defining a component as explained here

The component is then attached to an <a-entity>.

In this example, we create the move-with-rig component and attach it to the blue cube. The component makes the entity follow the rig. The rig is the common (conventional) name used for the entity containing the camera.

The component has

  • a schema
  • an init function
  • a tick function

The schema

TODO

The init function

TODO

The tick function

TODO

Resources