bevyengine / bevyengine/bevy

Rumble request panics if gamepad not found

Closed Beginner friendly
#25,761 0 comments 0 reactions 0 assignees View on GitHub
A-Input C-Bug D-Trivial I-Crash S-Ready-For-Implementation X-Uncontroversial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

The `handle_rumble_request` does a `.unwrap()` if it can't find a gamepad entity matching the request:

https://github.com/bevyengine/bevy/blob/main/crates/bevy_gilrs/src/rumble.rs#L92

Here's why I think we should change this: I'm envisioning a world in which steaminput game controllers also have entities, and it would be nice to be able to re-use the rumble request request for those as well. Technically, there is no barrier in the steam API that would prevent this.

Normally when running under Steam, the gilrs plugin would be disabled; but if for some reason it isn't, asking a steam controller to rumble would cause a panic.

See also #25757

@alice-i-cecile

Contributor guide

Open the contributing guide

Research direction

Start at crates/bevy_gilrs/src/rumble.rs:92 and inspect handle_rumble_request, then trace how requests for unmatched gamepad entities are handled. Verify the missing-gamepad and Steam-controller scenarios described here; done means the request no longer panics while existing rumble behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.