I have a UserInputJumpSystem that reads inputs from my main input system. It activates a bool on the jump component. I then have a JumpSystem that checks if I am grounded, then jump.
Sometimes the fixed step will miss this bool switch. Not sure what I can do to fix this. The execution order is pretty important here because I need the jump velocity to be affected the same frame as when you push the jump button. Any Ideas?
when you say “Sometimes the fixed step will miss this bool switch” what does that mean? The JumpSystem if (jump.activated) is false? if so, that means jumpInput = input.InputActions.Player.Jump.triggered; was also false. I haven’t used the input system, but maybe see if there is something like jumpInput = input.InputActions.Player.Jump.isPressed; you can call instead?
oh I see what you mean. var jumpInput = input.InputActions.Player.Jump.triggered; was true, but then that UserInputJumpSystem updated again and then jumpInput was false, before the JumpSystem : even runs.
While your tag version works, it seems super hacky to me and probably want to avoid it’s pattern when possible due to sync points.
But based on your tag solution, I can see the best of both worlds:
also consider putting both systems in the same simulation group, and set the UpdateAfter attribute. that will make sure they update in order. I’ve never done that before, so sorry I can’t share the exact code to do so.
yeah I have custom groups everywhere in my project. I can’t put these in the same sim though as my jump relies on some physics calculations, like checking the ground.