diff --git a/systems/input/controls_manager.gd b/systems/input/controls_manager.gd index 17db707..cd0da6e 100644 --- a/systems/input/controls_manager.gd +++ b/systems/input/controls_manager.gd @@ -269,12 +269,19 @@ func vibrate(device: int, weak_magnitude: float, strong_magnitude: float, durati ## effect and make it repeat instead." That's exactly what broke the lobby gate's 7-second ## rumble (the short 0.2 s hit-vibration works fine): this repeats vibrate() as short pulses ## to cover the same total duration instead of one long call. +## Explicitly stopping between pulses (rather than letting each one time out on its own) and +## spacing them out avoids re-triggering the effect faster than some drivers/browsers can +## retire the previous one — back-to-back-to-back start calls left the gamepad's rumble +## motor stuck reporting "busy" for the rest of the session on at least one setup. func vibrate_for(device: int, weak_magnitude: float, strong_magnitude: float, - total_duration: float, pulse: float = 0.3, gap: float = 0.1) -> void: + total_duration: float, pulse: float = 0.25, gap: float = 0.6) -> void: var elapsed := 0.0 while elapsed < total_duration: vibrate(device, weak_magnitude, strong_magnitude, pulse) - await get_tree().create_timer(pulse + gap).timeout + await get_tree().create_timer(pulse).timeout + if not OS.has_feature("web"): + Input.stop_joy_vibration(device) + await get_tree().create_timer(gap).timeout elapsed += pulse + gap