|
Post by ejlnmusic on Feb 8, 2018 17:22:54 GMT
Hi,
so I wanted to change weapon stamina cost per attack and failed miserably. :D So i tried following:
1) we have weapon (WeaponStrong is its name) 2) we have that weapon stamina cost (vMeleeWeapon script) 3) we want to change that cost per attack user use
In vMeleeCombatInput I have added 4 more strong attacks and bind them and they play nice and dandy Also I wanted to change stamina cost of weapon up there when user press different attacks ( and get stamina loss per attack) I will only have strong and weak weapon so this could work for me perfectly. So I reference float staminaCost of weapon and want to change it but this is where I fail....
WeaponStrong = GameObject.FindGameObjectWithTag ("Weapon").GetComponent<vMeleeWeapon>().staminaCost;
WeaponStrong = 5f; This throws NullReference....and keep banging my head why till I gave up and went for help. Any help much appreciated.
Alen
|
|