I am new to unity and I’m creating a game with multiple weapons to switch between each other. To check this code I made the program such that when i press a key a number will be incremented or decremented to give me the new weapon number by which I can switch between them. To test if my code is working properly I tried to create a Debug.Log() which could show the Number in the variable WeaponNum when I pressed the button. However, unity gives a compiler error to the code I put in, which was,
Debug.Log("WeaponNum = " WeaponNum);
Can anyone please help me with this please.