using UnityEngine; using UnityEngine.EventSystems; public class SelectOnInput : MonoBehaviour { public EventSystem eventSystem; public GameObject selectedObject; private bool buttonSelected = false; void Start() { } void Update() { if (Input.GetAxisRaw("Vertical") != 0 && !buttonSelected) { eventSystem.SetSelectedGameObject(selectedObject); buttonSelected = true; } } private void OnDisable() { buttonSelected = false; } }