Problem with input axis "Submit"
I have an UI button that activates a target selection script. This script lets you use arrow keys to cycle between different viable targets and then choose a target by pressing the return button on keyboard (if(Input.GetButtonDown("Submit")) in Update())
The problem is that when I press return, it also tries to press the last pressed button. I assume this is default functionality for the Submit axis as it's not something I have added. The problem with this functionality is that instead of choosing the target like I want to, it's actually pressing the target selection UI button (last pressed button) and thus disabling the targeting.
The weird thing also is that I haven't noticed this before even though I have been using this script for a while now. Maybe I accidentally activated this functionality somewhere, but if so, I don't seem to recall it.
Does someone have advice how to solve the problem, f.ex. by disabling this functionality of pressing the last pressed button? I could create a new Input axis to be used by the script, but that seems redundant and undesired as effectively I want to use the "Submit" button to submit the target selection.
Answer by Bearsauce · Aug 01, 2019 at 02:13 PM
Ah, it seems this is connected to the Navigation part of the button. I was able to solve the problem by changing the Navigation from Automatic to None. Still weird that this started happening so suddenly as I haven't touched the Navigation settings, but just glad it works now!
Your answer
Follow this Question
Related Questions
[InputManager] Bind Negative Button and Positive Button to Touch Input 0 Answers
Identify custom user input 0 Answers
How do I make my animation code work on both axes? 0 Answers
Huge drift Issue with xbox controllers. 0 Answers
Help changing input to axis 0 Answers