I’ve been following your tutorial on how to make a roguelike shooter like
Vampire Survivors, and as someone who has zero knowledge and experience in
programming, it is very easy to understand and keep up with. However, I am
stuck at one of the parts and I have no idea how to fix it, therefore I am
writing to you in this email.
I’m currently at Part 8 of the tutorial series where I am learning how to
make an inventory management system. After writing down the code for
levelling up the weapons and passive items, I find myself unable to solve
the issue where the weapons and passive items level up infinitely without
checking if for the next level and not producing an error log that says it
can’t go to the next level. The thing is, I have been following your
tutorial to a tee so I have no idea where in the code has gone wrong. I
would appreciate your help and hope to hear from you soon. Thank you!
Hi Dempster, I can think of one reason why this problem might be happening to your game.
It may be that your NextLevelPrefab field for all of the WeaponScriptableObjects (including the maximum level) are filled in. This would effectively allow the weapon to level up infinitely and not show the error message because once the maximum level is reached, since the NextLevelPrefab field is not null the code determines that there is a next level. Do doublecheck your set-up and make sure that the maximum level’s WeaponScriptableObject has been left empty.
Hope this helps!
If this solution does not work for you, could you consider sending a video and your code for the InventoryManager?