|
Post by Strider on Apr 22, 2017 4:23:39 GMT
Hi,
sorry to bother with this question. I've been messing with the animator controller for my character, but i'm not sure what i did, but i can start an attack, and if i press the jump button the character leaps into the air while doing his attack animation.
Any ideas what did i do and how to fix it?
Thanks!
|
|
|
Post by Invector on Apr 22, 2017 17:13:34 GMT
Open the vMeleeAttackInput and we have the bool method call MeleeAttackConditions, just add the condition && cc.IsGrounded there
|
|
|
Post by Strider on Apr 22, 2017 20:38:25 GMT
sorry, can you post an example for the code, i just get errors and don't really know what to write.
i have vMeleeCombatInput.cs, is the same file?
Thanks
|
|
|
Post by Invector on Apr 22, 2017 21:32:29 GMT
ops sorry, yes vMeleeCombatInput script, and find the method MeleeAttackConditions and add && cc.isGrounded as a condition to attack
protected virtual bool MeleeAttackConditions
{
get
{
if (meleeManager == null) meleeManager = GetComponent<vMeleeManager>();
return meleeManager != null && !cc.doingCustomAction && !cc.lockMovement && !cc.isCrouching && cc.isGrounded;
}
}
|
|
|
Post by Strider on Apr 24, 2017 4:48:17 GMT
Thanks, i put the code and there are no syntax errors, but the problem still happens, let me show you what is it. Basically is not that i can attack while jumping, but that i can jump while attacking.
Thanks!
|
|
|
Post by Invector on Apr 24, 2017 13:52:32 GMT
Hmmm this is happening probably because you have a very low "Allow Movement At" value on your attack animations, allowing the character to move again... a quickFix for your situation is to override the basic inputs and add a if (!cc.IsAnimatorTag("Attack")) , this will create allow you to move, but not do to any actions while the attack animation is playing.
protected override void InputHandle() { if (cc == null) return;
if (MeleeAttackConditions && !lockInputByItemManager) { MeleeWeakAttackInput(); MeleeStrongAttackInput(); BlockingInput(); } else { isBlocking = false; }
if (!isAttacking) { ExitGameInput();
if (!cc.lockMovement && !cc.ragdolled) { MoveCharacter(); if (!cc.IsAnimatorTag("Attack")) { SprintInput(); CrouchInput(); StrafeInput(); JumpInput(); RollInput(); ActionInput(); EnterLadderInput(); ExitLadderInput(); } } UpdateMeleeAnimations(); }
LockOnInput(); }
|
|