GetButtonDown in Abilities with and without EasyTouch not as expected?

DankP3

Active member
So, I think I dont understand Update in Abilities, or something is not correct (using UCC 2.1.5):

first without Easy Touch:

If I get a reference to PlayerInput and in update look for GetButtonDown and send a Debug.Log this works and sends a single message when in a generic monobehaviour in Update, but not when overriding update in a CharacterLocomotion Ability (it fires a variable number of times).

I installed EasyTouch and repeated:

GetButtonDown works in monobehaviour, but does nothing in override of Update in an Ability.

GetButton always seems to work (although I never checked it reports the same number of debug messages from both).

Am I missing something obvious? is Update in Abilities FixedUpdate? Thanks

Edit, I'll add with using keyboard and/or EasyTouch for Unity Inputs in the same test, The touch input doesn't seem to recognise GetButtonDown, but the keyboard fires multiple times. I can see I may be misusing EasyTouch for GetButtonDown, but the number of events is an issues eitherway.
 
Last edited:
Instead of calling PlayerInput directly within the ability update method you should instead register for an input event. Take a look at the jump ability for an example:

Code:
                    m_RepeatedJumpInput = ObjectPool.Get<ActiveInputEvent>();
                    m_RepeatedJumpInput.Initialize(ActiveInputEvent.Type.ButtonDown, InputNames[InputIndex], "OnJumpAbilityRepeatedJump");
                    m_Handler.RegisterInputEvent(m_RepeatedJumpInput);
 
Thanks, So I had thought i may need an event, but I guess I don't really understand how the Abilities run!
Edit: your above suggestion works fine of course, thanks.
 
Last edited:
Top