My issue is that when I enable it, the SetSelectedGameObject call is hitting my onClick event within that gameObject? Not sure why this would be happening.
Weirdly if I don’t use the controller at all (mouse) before I enable navigation, it works as expected - button is selected but NOT clicked. If I use the controller, the click is registered as soon as I re-enable navigation. What could the controller be doing that is causing this?
This problem still exists in Input System 1.4.4… did anybody find a solution for this?
My workaound is to register callbacks in coroutines with very short delay after I set the selected Gameobject.
Yeah I’m in version 1.3.0 (the newer ones don’t appear in the package manager in unity 2021.3.4f1 for some reason, but I need wsad player movement so I’m not going to bother upgrading until that’s fixed), the issue is in this version also and is incredibly frustrating.
Did anyone find a work around or fix that doesn’t involve coroutines or changing all button input to release instead of press? I have my code all nicely set up and I don’t want to make it convoluted by passing every single player input through a coroutine just to check if it’s really meant to be triggering any actions. Is there maybe a way to reset the input so it’s not being registered as performed when it really shouldn’t be?
I am on 1.6.3 (bug still present) and this seems to have solved the issue:
//where eventer is EventSystem and target is GameObject
eventer.sendNavigationEvents = false;
eventer.SetSelectedGameObject(target);
eventer.sendNavigationEvents = true;