Play Timeline on Entering AR/VR

Just about to test it now. Thanks for the extra suggestions :slightly_smiling_face: Back with feedback asapā€¦

by user 908977119781060648

Hmmmmmā€¦ no luck :thinking:

Iā€™ve tried:-

import {
  Behaviour,
  PlayableDirector,
  serializable,
  WebXR,
} from "@needle-tools/engine";
import { WebXREvent } from "@needle-tools/engine/engine-components/WebXR";

export class Play extends Behaviour {
  @serializable(PlayableDirector)
  timeline?: PlayableDirector;

  awake() {
    window.addEventListener("pointerdown", () => {
      if (this.timeline) {
        this.timeline.playOnAwake = true;
        this.timeline.play();
      }
    });
  }

  start() {
    WebXR.addEventListener(WebXREvent.XRStarted, () => this.timeline?.play());
  }
}

ā€¦ and itā€™s still not happening.

Even if I start the timeline via interaction so itā€™s actually running when I hit the AR button, the timeline has stopped when the AR version is displayed. As said, itā€™s really not a deal-breakerā€¦ but it would be cool to get to the bottom of it if possible :sunglasses:

by user 908977119781060648

Mmmh strange. I cant think of another reason for it to not play right now. Will try to test it as soon as i get a chance

Many thanksā€¦ and Iā€™ll try and test on another device asap in case thatā€™s the problem :slightly_smiling_face:

by user 908977119781060648