Hi all, I am having a weird problem today.
I have an item ability "Hold" and when some condition is met, the item ability will stop itself, and then start a new ability. I have something like this in the "Hold":
public override void Update()
{
base.Update();
if (conditionMet) {
m_CharacterLocomotion.TryStopAbility(this);
BlankTestAbility ability = m_CharacterLocomotion.GetAbility<BlankTestAbility>();
m_CharacterLocomotion.TryStartAbility(ability);
}
}
The CanStartAbility() function of the BlankTestAbility is called and returned true without a problem, but the AbilityStarted() will not be called and ability will not start.
public override bool CanStartAbility()
{
Debug.Log("try Start test ab");
return true;
}
Strange enough. I remember the same code worked when the "Hold" was a regular ability. As far as i can recall, this problem appeared after I changed it to item ability. (I have changed many other things to convert it into an item ability and I am not able to change it back to a normal ability to test becuase that would result huge changes in other abilities. However, the code that starts the BlankTestAbility was never changed.) The priority of BlankTestAbility is high enough to start. actually, the BlankTestAbility is not starting even though no other ability is playing.
So I wonder what situation this might be? When CanStartAbility return true but the ability refuse to start.
I have an item ability "Hold" and when some condition is met, the item ability will stop itself, and then start a new ability. I have something like this in the "Hold":
public override void Update()
{
base.Update();
if (conditionMet) {
m_CharacterLocomotion.TryStopAbility(this);
BlankTestAbility ability = m_CharacterLocomotion.GetAbility<BlankTestAbility>();
m_CharacterLocomotion.TryStartAbility(ability);
}
}
The CanStartAbility() function of the BlankTestAbility is called and returned true without a problem, but the AbilityStarted() will not be called and ability will not start.
public override bool CanStartAbility()
{
Debug.Log("try Start test ab");
return true;
}
Strange enough. I remember the same code worked when the "Hold" was a regular ability. As far as i can recall, this problem appeared after I changed it to item ability. (I have changed many other things to convert it into an item ability and I am not able to change it back to a normal ability to test becuase that would result huge changes in other abilities. However, the code that starts the BlankTestAbility was never changed.) The priority of BlankTestAbility is high enough to start. actually, the BlankTestAbility is not starting even though no other ability is playing.
So I wonder what situation this might be? When CanStartAbility return true but the ability refuse to start.