Block object to equip

claudius_I

New member
Hi, i added a animation system to the inventory and i want to know if there is a form to block the equip a object until the animation is end (like a method).

This is for avoid the player (in the hotbar) press many times to equip a item and destroy the code genrating a bug.

Thanks
 
I'm not completely following but within ShouldBlockAbilityStart you can prevent other abilities from starting when a certain ability is active. You can also use the state system to enable or disable a particular ability.
 
Ah, I see. There isn't an option built in which will prevent EquipUnequip from restarting if it is already started but you can subclass EquipUnequip and within CanStartAbility return false if it is already active.

Edit: another idea would be to use the state system and disable the EquipNext/Previous abilities when EquipUnequip is active. This will prevent you from needing to make any code changes.
 
Last edited:
Thanks

what is best part to call CanStartAbility?

i put in inside the "public override void UseItemAction" in class ItemViewSlotsContainerCategoryItemActionSetBinding and work well, but there is a best method to cal this instance?
 
Take a look at my edit - it may be a way to not have to make any code changes.

Beyond that for overriding CanStartAbility you'll need to create a new EquipUnequip subclass and use that.
 
Top