Environment: UISv1.2.5, UCCv2.4.5, URP, Unity2020.3.24f1
When I press the hotbar hotkey it does not equip the item. I am not sure if this is a problem with my configuration or a bug. The code that stops the item from equipping is in CharacterEquipUnequipHotbarAction (See CanInvokeInternal method copied below). The item is in a EquippableItemCollection, and so m_Equip is set to false. For the item to be equipped m_Equip needs to be true. My workaround is to remove the not (!) in the m_Equip assignment.
Before and after making this change I get the following warning message. How do I get rid of this?
@Sangemdoko One last thing. Just in case you remember. I posted on the discord a question about the hotkeys not mapping correctly. This was because in UltimateCharacterLocomotion, I had the start type on the EquipUnequip ability set to Button down. I changed this to manual (I think this is correct)
When I press the hotbar hotkey it does not equip the item. I am not sure if this is a problem with my configuration or a bug. The code that stops the item from equipping is in CharacterEquipUnequipHotbarAction (See CanInvokeInternal method copied below). The item is in a EquippableItemCollection, and so m_Equip is set to false. For the item to be equipped m_Equip needs to be true. My workaround is to remove the not (!) in the m_Equip assignment.
Before and after making this change I get the following warning message. How do I get rid of this?
Rich (BB code):
1 AssaultRifle (3729713782) || ItemCollection Hotbar (None) || ItemStack(-1171573632)[ 1 AssaultRifle (3729713782) in ItemCollection Hotbar (None)] cannot be moved to equippable because it was not in default first.
@Sangemdoko One last thing. Just in case you remember. I posted on the discord a question about the hotkeys not mapping correctly. This was because in UltimateCharacterLocomotion, I had the start type on the EquipUnequip ability set to Button down. I changed this to manual (I think this is correct)
C#:
/// <summary>
/// Returns true if the item action be invoked.
/// </summary>
/// <param name="itemInfo">The item.</param>
/// <param name="itemUser">The inventory user.</param>
/// <returns>True if it can be invoked.</returns>
protected override bool CanInvokeInternal(ItemInfo itemInfo, ItemUser itemUser)
{
var characterLocomotion = itemUser.gameObject.GetCachedComponent<UltimateCharacterLocomotion>();
if (characterLocomotion == null || !characterLocomotion.Alive) {
return false;
}
var inventorySystemBridge = itemUser.gameObject.GetCachedComponent<CharacterInventoryBridge>();
if (inventorySystemBridge == null) {
return false;
}
var item = itemInfo.Item;
// ====== Original Code ======
//m_Equip = !inventorySystemBridge.EquippableItemCollections.Contains(item.ItemCollection);
// ====== My Workaround ======
m_Equip = inventorySystemBridge.EquippableItemCollections.Contains(item.ItemCollection);
if (m_Equip) {
m_Name = m_EquipActionName;
} else {
m_Name = m_UnequipActionName;
}
return true;
}