rpk
New vMember
Posts: 9
|
Post by rpk on Jan 17, 2020 12:48:11 GMT
Greetings Invector, I am struggling to find out how to implement a melee attack with a shooter weapon like pistol or rifle. The Invector Shooter Template says 'Melee attacks for fire weapons' under the features. I am using the latest Shooter 2.5 version on unity 2019.2.10f1 Is there a bool or script I am missing ? None of the demo scenes have this ability either. The rifle & pistol prefabs have a V melee weapon script with hitbox, but I am not able to trigger a melee attack animation, when equipped with a shooter weapon. I wish to implement something like this below - gph.is/g/Zx2393O
|
|
|
Post by Invector on Jan 17, 2020 16:53:15 GMT
We already have this feature included but there is a condition (that shouldn't be there!) that is blocking the melee attack of the shooter weapon.
Open the vShooterMeleeInput, look for the InputHandle method > region MeleeInput and replace this line:
if (MeleeAttackConditions() && !_isAiming && !isReloading && !lockMeleeInput && (shooterManager.CurrentWeapon == null || (CurrentActiveWeapon == null && !shooterManager.hipfireShot)))
to this:
if (MeleeAttackConditions() && !_isAiming && !isReloading && !lockMeleeInput && !shooterManager.hipfireShot))
|
|
rpk
New vMember
Posts: 9
|
Post by rpk on Jan 18, 2020 19:22:13 GMT
Thanks Invector! That solved the issue.. cheers!
|
|
|
Post by aleksandr409 on Jan 18, 2020 20:15:17 GMT
It is perfectly!
|
|
|
Post by bbjones on Jun 15, 2020 18:29:28 GMT
Note that in version 2.5.2 (may 2020) this is still broken and the code doesn't match above.
I used this:
From: if (MeleeAttackConditions() && !_isAiming && !isReloading && !lockMeleeInput && !shooterManager.CurrentWeapon)
To: if (MeleeAttackConditions() && !_isAiming && !isReloading && !lockMeleeInput && !shooterManager.hipfireShot)
|
|