Search Unity

Question Update group for collecting input

Discussion in 'Entity Component System' started by Eldarado123, Nov 1, 2021.

  1. Eldarado123

    Eldarado123

    Joined:
    May 17, 2021
    Posts:
    7
    Hello, I've been having a hard time getting the jump mechanic to work properly in my game (it would often apply the jump force twice or more), so I eventually updated the new input system and started using the WasPressedThisFrame method so that the jump force would be certain to be applied exactly once every time I press the jump button. The problem is that this method doesn't always detect that I pressed the jump button (it works maybe half of the time). I suspect that I need to specify which group my input collection system should update in, but I'm not sure which group that should be. Any advice would be appreciated!
     
  2. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    https://github.com/Unity-Technologi...ts/Common/Scripts/DemoInputGatheringSystem.cs

    Here's an example system from Unity themselves using the new input system and DOTS together.

    Now I also read somewhere that the new input system and DOTS do not work well together in versions other than 2019.3. I cant find it anymore so I dont know if I just hallucinated it (staring at DOTS source code for long enough can do that to me). I personally am just using the old input system and a simple monobehavior script that directly modifies a singleton for the input for that frame. It works reliably and has never been a problem.