every time i try to use my weapon swap (part of my inventory) i switches to the nest weapon, then stops how do i fix it?
if (weapons.Count >= 2) {
if (Input.GetKeyDown(KeyCode.E)) {
curwep -= 1;
}
else if (Input.GetKeyDown(KeyCode.E)) {
curwep += 1;
}
if (curwep >= weapons.Count) {
curwep = 0;
}
else if (curwep < 0) {
curwep = weapons.Count - 1;
}
}