#Reload script issue

1 messages · Page 1 of 1 (latest)

normal lark
#

so

#

are all debugs reaching you?

lavish light
#

they are

normal lark
#

add a Debug.Log(MagazineSize + " " + BulletsLeft + " " + MagazineReserves );

#

also this is correct, my bad

lavish light
#

in the reloadfinished funtion?

normal lark
#

yessir

lavish light
normal lark
#

yup

lavish light
normal lark
#

what is the number 4422? is it this add a Debug.Log(MagazineSize + " " + BulletsLeft + " " + MagazineReserves );?

lavish light
#

yes

normal lark
#

but it says there are 4 bullets left?

#

so there are bullets in magazine

#

maybe ui isnt updating

lavish light
#

MagazineAmmoText.SetText(BulletsLeft + "");
ReserveAmmoText.SetText(MaxReserveAmmo + "");

#

it should be according to these 2 lines

normal lark
#

add them in the reload function too

#

to update them

#

unless theyre in update()

lavish light
#

they are

normal lark
#

add them anyway, since they should say 4 but still arnt

lavish light
#

done but still doenst subtract

normal lark
#

hmm

#

have u tried to shoot through ur entire magazinereserve to check if it works, if it does then its just a ui problem otherwise u gotta rework some code

lavish light
#

ill try that brb

normal lark
#

seems good

#

i gtg soon tho

#

in like 2 minutes

lavish light
#

its a ui problem

normal lark
#

thats good!, just look thru the ui, i think i know the problem, lemme dubble check

#

ah i see the problem

#

hahahahaha

lavish light
#

ohno

normal lark
#

ReserveAmmoText.SetText(MaxReserveAmmo + "");

#

should me reserveammo

#

be*

#

also BulletSpawnpoint = transform.Find("BulletSpawner"); //Find the BulletSpawner
FPSCam = GameObject.Find("FPSCam").GetComponent<Camera>(); //find the camera
IzanagiController.GetComponent<Animator>(); //Get the animator
CanIdle = true;
BulletsLeft = MagazineSize; //When weapon spawns set to max ammo
ReadyToShoot = true; //On Spawn you are able to shoot
ReserveAmmoLeft = true; //We have reserve ammo avaiable
IzanagiFire = GetComponent<AudioSource>(); //Get access to the FireSound
IzanagiReload = GetComponent<AudioSource>(); //Get access to the FireSound
IzanagiHeavyReload = GetComponent<AudioSource>(); //Get access to the FireSound
MagazineAmmoText = GameObject.Find("WeaponAmmoText").GetComponent<TextMeshProUGUI>(); //Find the AmmoText
ReserveAmmoText = GameObject.Find("WeaponReserveAmmoText").GetComponent<TextMeshProUGUI>(); //Find the ReserveAmmoText

#

this is very inefficient

#

you should just a public, datatype and it will be more efficient

#

but i wouldnt if i was u, too lazy

lavish light
#

there are going to be like 50 of these scripts

#

i aint attatch 20 components on 50 diffrent scripts XD

normal lark
#

i mean you could just copy a component and it will save it

#

so if u do it once

#

boom

lavish light
#

i can try that

#

thanks tho

#

it worked

lavish light
normal lark
#

np

#

have a nice day