Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Colinsky |
Hello, I do a FPS project and this is my code:
# ----------------------------------
# Changing weapons.
var weapon_change_number = WEAPON_NAME_TO_NUMBER[current_weapon_name]
if Input.is_key_pressed(KEY_1): <= here the error
weapon_change_number = 0
if Input.is_key_pressed(KEY_2):
weapon_change_number = 1
if Input.is_key_pressed(KEY_3):
weapon_change_number = 2
if Input.is_key_pressed(KEY_4):
weapon_change_number = 3
Unexpected token: if
What is wrong with this code?