From 47f15520006d8766ed147ce8151b7373a796ed55 Mon Sep 17 00:00:00 2001 From: goynov Date: Sat, 28 Feb 2026 10:12:13 +0200 Subject: [PATCH] bugfix --- src/components/InteractiveObjects/VideoPlayer.js | 3 ++- src/lib/Hero.js | 7 ++++--- src/mixins/GameEnvironmentMixin.js | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/InteractiveObjects/VideoPlayer.js b/src/components/InteractiveObjects/VideoPlayer.js index 8cedb3c..cc9106b 100644 --- a/src/components/InteractiveObjects/VideoPlayer.js +++ b/src/components/InteractiveObjects/VideoPlayer.js @@ -11,9 +11,9 @@ class VideoPlayer extends EventManager { let vi, plane, finished = false; return new Promise((resolve, reject)=>{ vi = document.createElement('video'); - vi.src = engine.assetPath + data.$go.asset.name; vi.addEventListener('loadedmetadata', async ()=>{ this.aspect = vi.videoWidth / vi.videoHeight; + if (isNaN(this.aspect)) this.aspect = 16/9; let geometry = new PlaneGeometry( this.aspect * 0.88, 0.88 ); let map = new VideoTexture( vi ); map.colorSpace = SRGBColorSpace; @@ -78,6 +78,7 @@ class VideoPlayer extends EventManager { resolve(this); }) + vi.src = engine.assetPath + data.$go.asset.name; }) } } diff --git a/src/lib/Hero.js b/src/lib/Hero.js index c6225d7..c25ac67 100644 --- a/src/lib/Hero.js +++ b/src/lib/Hero.js @@ -55,8 +55,8 @@ class Hero{ // console.log('hero', size, center, size.y - 2*this.characterGapOffset) - this.runVelocity = this.size.y * 5 - this.walkVelocity = this.size.y * 3 + this.runVelocity = this.size.y * 4 + this.walkVelocity = this.size.y * 1 this.po = engine.physics.add(this.model, 'kinematicPositionBased', false, undefined, 'capsule', { radius: this.size.y/4, halfHeight: this.size.y/4}) this.po.collider.setTranslationWrtParent({x: 0, y: this.size.y/2, z: 0}); @@ -136,11 +136,12 @@ class Hero{ this.fadeDuration = 0.2; if (input[1] && pc.running) { play = 'run'; + velocity = this.runVelocity; } else if (input[1] > 0) { play = 'walk' } else if (input[1] < 0) { play = 'backward' - velocity = this.walkVelocity / 3 + velocity = this.walkVelocity * 0.9 } else if (input[0] < 0) { play = 'right' } else if (input[0] > 0) { diff --git a/src/mixins/GameEnvironmentMixin.js b/src/mixins/GameEnvironmentMixin.js index 3d918ff..540ff8f 100644 --- a/src/mixins/GameEnvironmentMixin.js +++ b/src/mixins/GameEnvironmentMixin.js @@ -168,6 +168,7 @@ export default { if (this.scene.data.items){ let loaded = 0; for (let i of this.scene.data.items) { + this.debug('Loading', i); if (this.env != 'GameDesigner'){ if (i.data.activationTriggers?.length || i.data.activationScore){ i.data.shouldBeLocked = true;