It looks like you're new here. If you want to get involved, click one of these buttons!
Hello, i want to improve my weapon switching system. I have followed brackeys tutorials and everything works completely fine. Now i want to add the feature that you can pick up weapons(i know that you can do that with colliders).
1. Problem: how do I make a weapon which i pick up a child of my parentObject (parentObject is the WeaponSwitcher which has the script WeaponSwitchingon it).
2. Problem: When i pick up different weapons they get a different order - so when you want to reference the script from another script for example you want to know if the knife is selected (which is currently my 3rd childObject) i can just say: if(selectedWeapon ==2) which works fine. But when they get in a different order it doesnt work so i think i should like call the childObjects by their name (sth. like: if(selectedWeaponString == "Knife") or anthing like that) or tag? Or is there maybe some other way or do i need to make a complete different system?
I appreciate if someone help me with this problem because it would improve my game a lot. Thanks :)