# Play Timeline on Entering AR/VR

**URL:** <https://forum.needle.tools/t/play-timeline-on-entering-ar-vr/636>\
**Category:** 🌵 Needle Engine\
**Tags:** question\
**Created:** [February 16, 2023, 12:00am UTC](https://forum.needle.tools/t/play-timeline-on-entering-ar-vr/636 "2023-02-16T00:00:00Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [February 18, 2023, 12:00am UTC](https://forum.needle.tools/t/play-timeline-on-entering-ar-vr/636/21 "2023-02-18T00:00:00Z")

</div>

Just about to test it now. Thanks for the extra suggestions 🙂 Back with feedback asap…

_by user 908977119781060648_

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [February 18, 2023, 12:00am UTC](https://forum.needle.tools/t/play-timeline-on-entering-ar-vr/636/22 "2023-02-18T00:00:00Z")

</div>

Hmmmmm… no luck 🤔

I’ve tried:-

```ts
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 🕶

_by user 908977119781060648_

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [February 18, 2023, 12:00am UTC](https://forum.needle.tools/t/play-timeline-on-entering-ar-vr/636/23 "2023-02-18T00:00:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [February 18, 2023, 12:00am UTC](https://forum.needle.tools/t/play-timeline-on-entering-ar-vr/636/24 "2023-02-18T00:00:00Z")

</div>

Many thanks… and I’ll try and test on another device asap in case that’s the problem 🙂

_by user 908977119781060648_

[Previous page](https://forum.needle.tools/t/play-timeline-on-entering-ar-vr/636.md?page=1)
