#simple problem related to ammo

10 messages · Page 1 of 1 (latest)

wind tartan
#

can't the script have more than one ammo?

wind aurora
#

Can you break down exactly how you have this set up in Godot and how you're creating the new guns?

ripe osprey
#

I have something which works kinda like that a weapon manger which let's you switch weapons but the only problem is that it's taking the children of the weapon manger and counts them as numbers in var weapon = 0 so it adds to it and switches according to that integer
so all the switching is in the weapon manger and that's basically all what the weapon manger does and all the shooting and behavior of the weapons is handled in one script which i named guns it handles every thing about the gun from it's variables to actually shooting
now the main problems i face are

  1. when the game starts at the first weapon and you press the change weapon button it doesn't actually work until you press it another time at first and when you do that it works fine for the rest of the time your running the game
#
  1. when the SMG i created as an inherited scene from the guns scene which contains the gun script for behavior and some basic stuff when the SMG empties the clip it uses the clip of the pistol as i had made the ammo variable an export var so i can modify it for every gun so the ammo for SMG is 50 and the pistol got 25 when the first 25 get used they get used as SMG ammo with SMG bullet speed and SMG stats then when you use 25 and reach the number of ammo in the other gun it start's using both for some reason
#

HERE ARE THE SCRIPTS

#

THIS IS THE GUNS SHARED SCRIPT

#

THIS IS THE WEAPON MANGER SCRIPT