Is your feature request related to a problem? Please describe.
In some cases, it would be convenient to be able to send one-off events as part of the input struct:
struct Input {
fire_just_pressed: bool,
jump_held: bool,
}
However, when predicting, we would then get fire_just_presed == true repeatedly when predicting.
Describe the solution you'd like
Instead of just copying the input struct, perhaps it would make sense to be able to inject a prediction function?
session_builder.with_input_prediction(|input| {
Input { fire_just_pressed: false, ..input }
})
|
let prediction_to_return = self.prediction; // PlayerInput has copy semantics |
Describe alternatives you've considered
Handling just_pressed logic inside the ggrs advance frame step works as a workaround, but sometimes the events you get from game engines are one-offs (bevy ui button press events etc.), so it generates a lot of boilerplate
Additional context
https://discord.com/channels/844211600009199626/844211600009199629/1175361006717898763
Is your feature request related to a problem? Please describe.
In some cases, it would be convenient to be able to send one-off events as part of the input struct:
However, when predicting, we would then get
fire_just_presed == truerepeatedly when predicting.Describe the solution you'd like
Instead of just copying the input struct, perhaps it would make sense to be able to inject a prediction function?
ggrs/src/input_queue.rs
Line 144 in 48aec70
Describe alternatives you've considered
Handling just_pressed logic inside the ggrs advance frame step works as a workaround, but sometimes the events you get from game engines are one-offs (bevy ui button press events etc.), so it generates a lot of boilerplate
Additional context
https://discord.com/channels/844211600009199626/844211600009199629/1175361006717898763