Prevent Jump Ability while Aiming

incendy

New member
I am able to see the ability by checking the code below, just not sure where I can put it in code without breaking things to cancel the jump. I tried to put it in jump.cs in the ability started method, which did prevent the jumping but caused other weird issues.

//in my case the Aim Ability is the 7th item in the list.
var checkAiming = m_CharacterLocomotion.ItemAbilities[7];
if (checkAiming.IsActive)
{
return;
}
else{
//do jump code
}

any help appreciated! Thank you
 
Never mind, I figured it out by looking at the SpeedChange prevention. The following in Aim.cs did the trick

private bool PreventAbility(Ability activeAbility)
{
// InputStart isn't set until AbilityStarted so the InputIndex should be used as well.
if (m_StopSpeedChange && (InputIndex != -1 || m_InputStart) && activeAbility is SpeedChange) {
return true;
}
if (activeAbility is Jump)
{
return true;
}

return false;
}
 
Top