diff --git a/packages/topdown/src/traits/followed.js b/packages/topdown/src/traits/followed.js index 5fc6954..c27324d 100644 --- a/packages/topdown/src/traits/followed.js +++ b/packages/topdown/src/traits/followed.js @@ -28,6 +28,11 @@ export default (flecks) => class Followed extends Trait { }; } + initialFollow() { + this.updatePosition(); + this.onRoomSizeChanged(); + } + listeners() { return { @@ -45,8 +50,17 @@ export default (flecks) => class Followed extends Trait { this.$$camera = json.camera; } this.$$camera.viewSize = this.params.viewSize; - this.updatePosition(); - this.onRoomSizeChanged(); + this.initialFollow(); + } + + methods() { + return { + + initialFollow: () => { + this.initialFollow(); + }, + + }; } onRoomSizeChanged() {