Hello,
I'm trying to change a specific weapon when the interact starting.
IInteractableTarget's Interact method run too late, but if I try to run the EquipWeapon script here it's not working.
EquipWeapon script:
This script 100% working. If I call this from IInteractableTarget's CanInteract it's working, but wrong time.
I'm trying to extend the Interact ability and call from the "AbilityStarted" or "DoInteract" methods, but still not work.
Sorry, my english grammar is very poor, so here is a video where I want to switch to crowbar on interact
(Crowbar's hand not animating, but that's another promlem )
Where I can call StartEquipUnequip before interact?
I'm trying to change a specific weapon when the interact starting.
IInteractableTarget's Interact method run too late, but if I try to run the EquipWeapon script here it's not working.
EquipWeapon script:
private void EquipWeapon(GameObject character)
{
var characterLocomotion = character.GetComponent<UltimateCharacterLocomotion>();
var equipUnequipAbilities = characterLocomotion.GetAbilities<EquipUnequip>();
for (int i = 0; i < equipUnequipAbilities.Length; ++i) {
if (equipUnequipAbilities.ItemSetCategoryIndex == categoryIndex) {
Debug.Log("start equip " + changeToWeaponItemSetIndex);
equipUnequipAbilities.StartEquipUnequip(changeToWeaponItemSetIndex, true, true);
return;
}
}
}
This script 100% working. If I call this from IInteractableTarget's CanInteract it's working, but wrong time.
I'm trying to extend the Interact ability and call from the "AbilityStarted" or "DoInteract" methods, but still not work.
Sorry, my english grammar is very poor, so here is a video where I want to switch to crowbar on interact
(Crowbar's hand not animating, but that's another promlem )
Where I can call StartEquipUnequip before interact?