class Caster extends GameObject { lastResult = {}; update (deltaTime) { if (!GameInput.mousePosition) return; this.collider.enabled = true; if (this.collider.isInBounds(GameInput.mousePosition)) { console.log("hoverin"); } } draw (context) { if (!GameInput.mousePosition) return; super.draw(context); let origin = this.transform.position; let dir = GameInput.mousePosition.subtract(this.transform.position).normalize(); let ray = Ray.Cast(this.scene, this.transform.position, dir); if (ray) { // Canvas2d stroke APIs are unavailable under WebGL (scene.context is gl). // Keep raycast for debug state; visual line omitted pending a GL line helper. this.lastResult = ray; } } }