I wanted to ask, why did you set up InputSystem and PlayerInputSystem separately. you can do the task in one class right? just want to know why choose that architecture ♥
In our scenario - yes, you can! However, if you want to add a mini-game like Memory, or handle some custom UI popups, or anything else to your game, you can split the responsibility to the MemoryGameInputSystem and SomeCustomInputSystem. For me, PlayerInputSystem is strictly related to the "Game" section, so - if it is more readable for you - you can call it GameInputSystem ❤️
In my debug.log i get double logs for each button press. like if i press A i get -1 two times, and when i press D i get 1 two times. what could be causing this?
Harry's case (after talking on Discord) - He was using Unity Netcode for ECS, so there were two worlds: client and server - so he had duplicated Debug.Logs Solution: - Use [WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation)] attribute for InputSystem class, so only client instance gets Debug.Log()
I wanted to ask, why did you set up InputSystem and PlayerInputSystem separately. you can do the task in one class right? just want to know why choose that architecture ♥
In our scenario - yes, you can! However, if you want to add a mini-game like Memory, or handle some custom UI popups, or anything else to your game, you can split the responsibility to the MemoryGameInputSystem and SomeCustomInputSystem. For me, PlayerInputSystem is strictly related to the "Game" section, so - if it is more readable for you - you can call it GameInputSystem ❤️
In my debug.log i get double logs for each button press. like if i press A i get -1 two times, and when i press D i get 1 two times. what could be causing this?
Make sure you only add the subscription to the Input event once 😊
Harry's case (after talking on Discord)
- He was using Unity Netcode for ECS, so there were two worlds: client and server - so he had duplicated Debug.Logs
Solution:
- Use [WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation)] attribute for InputSystem class, so only client instance gets Debug.Log()