Hi guys!
A have a problem in my game with UI buttons. For some reason they stay focused after one pressing, and after this pressing the “space” on the keyboard make them act like they are being pressed. I fixed this issue with setting buttons “navigation mode” to none in the editor.
The current problem is that i have some buttons that are created realtime during the game by code. How can i set those buttons navigation mode to “None” through code that instantiates it?
I tried
ElementButton.navigation.mode = Navigation.Mode.None;
But unity says me: “Cannot modify the return value of ‘Selectable.navigation’ because it is not a variable”
What am i missing?