Hello! I’ve been starting to tinker with the new input system, and I really like it so far. However, I’m a bit confused on how the input is received controls.Harvester.Harvest.performed += context => Harvest(context.ReadValue<float>());
only triggers when a button is pressed, but how do I constantly read the value? My script only finds out when the button is pressed or held, but never released (such as Input.GetButtonUp
in the old input system.) Any ideas on how to achieve this? Thanks in advance!
There multiple ways. Shortest one is set up your action as “continuous”, so it gonna invoke prefrormed event each update. Yet, for me tieing up your buisness logic with input looks like pretty bad idea.
So, it probably whould be better to use your own Update/Coroutine/RxObservable with “pass through” action, which performed both on button down and up.