I have 4 deactivated swords on my player that I use to switch weapons(deactivate one then activate the other). So far I’ve gotten buying, and equipping using this method but only when I’m in the same scene testing it, when I try switching scenes and see if the shop works, It just switches swords on the deactivated player I used for a place holder. I’m fairly new at Unity so any help will be appreciated!
Here’s a tutorial that can help you with this & similar situations:
Some options/keywords for various methods would be:
- DontDestroyOnLoad
- saving to disk (with or without serialization)
- PlayerPrefs
- static variables.
Pick one that suits you for now, but keep them all in mind, because some are better than others - it depends on the situation
I wrote this list in addition to the tutorial link, in case you wanted to investigate one or more of these options beyond the video (or instead of).