diff --git a/fission/src/systems/input/InputSystem.ts b/fission/src/systems/input/InputSystem.ts index 6c39f477f..282f5c02e 100644 --- a/fission/src/systems/input/InputSystem.ts +++ b/fission/src/systems/input/InputSystem.ts @@ -183,14 +183,16 @@ class InputSystem extends WorldSystem { this.gamepadDisconnected = this.gamepadDisconnected.bind(this) window.addEventListener("gamepaddisconnected", this.gamepadDisconnected) - InputSystem.leftJoystick = new Joystick( - document.getElementById("joystick-base-left")!, - document.getElementById("joystick-stick-left")! - ) - InputSystem.rightJoystick = new Joystick( - document.getElementById("joystick-base-right")!, - document.getElementById("joystick-stick-right")! - ) + window.onload = () => { + InputSystem.leftJoystick = new Joystick( + document.getElementById("joystick-base-left")!, + document.getElementById("joystick-stick-left")! + ) + InputSystem.rightJoystick = new Joystick( + document.getElementById("joystick-base-right")!, + document.getElementById("joystick-stick-right")! + ) + } // Initialize an event that's triggered when the user exits/enters the page document.addEventListener("visibilitychange", () => { diff --git a/fission/src/systems/scene/Joystick.ts b/fission/src/systems/scene/Joystick.ts index 3dc6b059d..c604da34c 100644 --- a/fission/src/systems/scene/Joystick.ts +++ b/fission/src/systems/scene/Joystick.ts @@ -41,7 +41,7 @@ class Joystick { private onPointerUp(event: PointerEvent) { if (this.activePointerId !== event.pointerId) return - this.stickPosition = { x: 0, y: 0 } + this.stickPosition = { x: 0, y: 0 } this.stickElement.style.transform = `translate(-50%, -50%)` this.baseRect = null } diff --git a/fission/vite.config.ts b/fission/vite.config.ts index ead5ab543..428d7d061 100644 --- a/fission/vite.config.ts +++ b/fission/vite.config.ts @@ -9,7 +9,7 @@ const serverPort = 3000 const dockerServerPort = 80 const useLocal = false -const useSsl = true +const useSsl = false const plugins = [ react(), glsl({