cyhak
Full vMember
Posts: 80
|
Post by cyhak on Sept 4, 2018 12:59:23 GMT
Hi community i am working on UI Dialog where then player can click on UI Button and the AI should reload his weapon but i don't know why it is not working or if i am completely wrong ? I am a newbie sor forgive me :D
|
|
cyhak
Full vMember
Posts: 80
|
Post by cyhak on Sept 4, 2018 14:27:39 GMT
@invector pls help me :I
|
|
|
Post by Invector on Sept 4, 2018 15:02:24 GMT
If you look in the code, the bool is actually to ignore the reload animation
public void ReloadWeapon(bool ignoreAnim = false)
and there is a verification to it will only reload if the ammo count is lower than the clipsize
if (!((weapon.ammoCount >= weapon.clipSize)) && !weapon.autoReload)
So basically you need to uncheck the bool in the inspector, and comment the line 197 to ignore the ammocount and do the reload anyway.
|
|
cyhak
Full vMember
Posts: 80
|
Post by cyhak on Sept 4, 2018 15:06:41 GMT
thank you very much this helped. Prior to your solution i added the Reload animation as customaction in AI Animator and Played it on event this also works but your solution is better. Invector is just amazing man !!
|
|
|
Post by Invector on Sept 4, 2018 15:12:36 GMT
Actually, if you just want to play the reload animation your solution also works and doesn't need to modify the script ;)
|
|