Skip to content

Commit

Permalink
Skip pinning animations if already running
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Sep 14, 2021
1 parent c2f5610 commit 9c4f830
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/pinnable.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ AFRAME.registerComponent("pinnable", {
}

if (isMine) {
if (
this.el.components["animation__pin-start"]?.animationIsPlaying ||
this.el.components["animation__pin-end"]?.animationIsPlaying
) {
return;
}

this.el.removeAttribute("animation__pin-start");
this.el.removeAttribute("animation__pin-end");
const currentScale = this.el.object3D.scale;
Expand Down

0 comments on commit 9c4f830

Please sign in to comment.