#Weapon Stats canvas showing incorrect information
1 messages · Page 1 of 1 (latest)
picked up quad burst, mince maker now on the floor
these stats dont make sense, does anyone know what i've done wrong?
its mainly the arrows that are incorrect on the right hand side
float critMultiplier = (critDamage / damage) * 100;
float currentWeaponCrit = (float)currentWeaponConfig.HeadShotDamage / (float)currentWeaponConfig.Damage;
SetStatIndicator(critMultiplier, currentWeaponCrit, critArrow);
``` critMultiplier is always 100 times larger than the other, ```cs
float fireRate = 1f / config.FireRate;
float currentWeaponFireRate = 1f / currentWeaponConfig.FireRate;
SetStatIndicator(config.FireRate, currentWeaponFireRate, fireRateArrow);
``` doesn't even use the defined fireRate variable, or if you didn't mean to do that anyway then you're comparing new fire rate to 1 / fire rate
also dunno why but damage, spread, reload speed and consumption rate don't seem to work at all
ah crit yea! i did just change firerate just now, must of forgot about that bit
like you say, unsure why damage, spread and reload just arnt working
Tom I have to critique the whole design of this script. Why doesnt the data for the canvas come from one source? Like why do you have to do calculations when initing the canvas? Also cant you make the rarity enum into a struct and have it carry its color info and what not and avoid tje whole switch thing
Also why not implement Icomparable on your weapon data and return a array from that operation that tells you the stats comps like -1 worse 0 same 1 better
heres a video, it is just seemingly totally broke for no reason
because im still learning aye, though i'll refactor it once its not broken
I just dont know why its broken
https://paste.myst.rs/tui7vtk5 this is what creates the canvas and calls the function
I fixed it