diff --git a/src/components/sticky-object.js b/src/components/sticky-object.js index 0cf3e3c53063af0fff3276d124d59ea9c59cd892..b79fa8017c45f93e7d3d9e8ee5dfc3cb1da7d254 100644 --- a/src/components/sticky-object.js +++ b/src/components/sticky-object.js @@ -33,10 +33,6 @@ AFRAME.registerComponent("sticky-object", { this.el.removeEventListener("grab-end", this._onRelease); }, - remove() { - this.el.removeEventListener("body-loaded", this._onBodyLoaded); - }, - setLocked(locked) { if (this.el.components.networked && !NAF.utils.isMine(this.el)) return; @@ -64,6 +60,7 @@ AFRAME.registerComponent("sticky-object", { }, remove() { + this.el.removeEventListener("body-loaded", this._onBodyLoaded); if (this.stuckTo) { const stuckTo = this.stuckTo; delete this.stuckTo;