problem with my practice program

Blitz3D Forums/Blitz3D Beginners Area/problem with my practice program

FYI, What are the forum codes?

Here's your problem:
If KeyDown(2) Then weapon1= LoadMesh("SWORD.3ds", camera)
If KeyDown(3) Then weapon2= LoadMesh("pdpistol.3dd", camera)
This is a bad coding technique.

Your weapons should be loaded at the beginning of your program, NOT if you happen to be pressing the 1 or 2 key.

Remember, this code is only executed at the time your program starts, it is never executed again, so unless you happened to be holding down the 1 or 2 key at the time the program started, neither weapon would have loaded.

Your weapons should be loaded like in my example:
weapon1 = LoadMesh("sword.3ds", camera)
weapon2 = LoadMesh("bdpistol.3ds", camera)
Then, IN THE GAME LOOP (inside of the While Not KeyHit(1)-Wend loop), add your code for switching weapons like so:
If KeyDown(2)
  ShowEntity weapon1
  HideEntity weapon2
Endif
If KeyDown(3)
  ShowEntity weapon2
  HideEntity weapon1
Endif