private void Move() { // Cache last selected int lastSelected = selected; int delta = 0; // Only move if already on target slot if (closeEnough) { // Move selector with input axis delta = Mathf.CeilToInt(Owner.GetAxis("Horizontal", raw: true)); selected += delta; // Don't fall into an occupied character slot if (other.selected == selected) { // If selected is on limit, just stop if (other.selected == 3 || other.selected == 0) { selected -= delta; } // Otherwise, pass over else { selected += delta; } } // Clamp value selected = Mathf.Clamp(selected, 0, 3); } // If value has changed if (lastSelected != selected) { // Set as not-ready anim.SetBool("Ready", false); // Switch crystal states showcase[selected].SwitchCrystal(value: true); showcase[lastSelected].SwitchCrystal(value: false); } }