Hey guys!
First of all, if this seems familiar, it is. I seriously can’t seem to get this one down…despite posting about it already (but that post wasn’t EXACTLY like this one; that was a gun pickup system)
I want to know any method at all for 3 or 3+ gun changes
Of course, adding in changing animations and reload must be able to be added
I have added a one gun and two gun system…I don’t know why I created them…but here they are OneGun.blend (248 KB) TwoGun.blend (249 KB)
Anything that works will do. Thanks
No code changes. The error was caused because you’re trying to divide something by 0. Which probably means that you haven’t defined your properties properly, and your script is treating the variable as 0.
What I like to do for the gun system is this. Have four (or “however many guns you have/want + 1”) properties. Three (or however many) properties for the guns, and have one be for “Holding”.
Put whichever weapon slot should be active into the "Holding’ property.
When your player picks up a gun, have a script check through the different gun properties. If one’s empty, set that property as the gun you picked up.
When you switch guns, have a system that checks the “Holding” property to see which slot is active, then change it to whichever slot comes next. For example: "if object[‘Holding’] == “slot1”: (then) object[‘Holding’] = “slot2"”
Finally, have a system that sets your player’s gun based on what the “Holding” property is.
Yeah I got it. Just needed to tinker with it…Got the blend file working also
making changes to the naming and re-doing the shooting system to make it more realistic…will probably be done an hour or two
Oh, and I think your system is great, except it may be a little unrealistic. Guns usually contain different clips, so if I have 2 guns with the same ammo, what if I want them to so different damage, or shoot at different rates? The point is, I think having 100 lazers for all your guns isn’t a good choice, instead make each gun have different clip capacity. For example: gun1 has 50, gun2 has 30, gun3 has 20 bullets, and they can’t share them…But that’s just a suggestion
I also realized that if I have a gun, I can’t pick up another one unless I don’t hold anything. maybe if I have a gun and pickup a gun, it automatically switches to that picked up gun?
Did a little bit or renaming with it, changed it so that there are no extra logic bricks in the “Player” cube…Up until now, everything worked out fine, I changed the positions of the weapons on layer 2, and I don’t know why I pickup all 3 and I cycle through the 2nd,1st, then third weapon…So I pickup all the boxes, hit up arrow, and the 2nd wep shows up…why?WeaponManagerBeta2 (Z).blend (902 KB)
mean in line 26 of PickUpGun?
Where is the animation and why is there a useless animation for all the guns?
I want to try changing the guns to more graphical looking (but still low poly) ones
and make an arm animation, parenting the gun to the right/left arm, but I don’t know where the animation and how the parenting works in the code