ItemType category doesn't match the parent category

magique

Active member
I'm following the video on setting up a melee weapon and there are a few differences in the video and the current asset. When I get to 10:30 in the video where it talks about the Item Set Manager, I noticed that my character doesn't have any item sets at all, but just the default loadout. So, I don't know why that didn't happen. So, I went ahead and added them myself. The Item Set 0 works fine and I assign the item type to sword, but when I try to set the second item set to Body type, it complains with the following error:

Error: Unable to add ItemType Body - the ItemType category doesn't match the parent category.
UnityEngine.Debug:LogError(Object)
Opsive.UltimateCharacterController.Editor.Inspectors.Inventory.ItemSetManagerInspector:DrawSelectedItemSet(ItemSet, Int32) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Inventory/ItemSetManagerInspector.cs:352)
Opsive.UltimateCharacterController.Editor.Inspectors.Inventory.ItemSetManagerInspector:OnInspectorGUI() (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Inventory/ItemSetManagerInspector.cs:104)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

I thought this might be some mismatch between the DemoItemCollection and my own ItemCollection, but I've double checked everything and I'm only reference my items from my collection and my item types from my item collection. At one point it didn't throw the error at all, but the Body item type just never got assigned to the inspector field.
 
The categories are defined within the Item Type Manager - you'll either want to make sure there is a (none) assigned or it is correctly assigned to the category that you are adding it to. In the demo scene the Body ItemType is assigned to the Weapons category.
 
The categories are defined within the Item Type Manager - you'll either want to make sure there is a (none) assigned or it is correctly assigned to the category that you are adding it to.

While I'm a big fan of your cookie-cutter support style, here's a video of the bug in action:

 
@almostchris Thanks for posting the video. After trying this again and making sure the Body type has a proper category, it still fails just as your video shows.
 
I actually finally got this to work. If I make the Body type item category Items then it likes it. I first tried using a category called Weapons and when I changed my sword to just be Weapons, then the sword disappeared from my player. So, I let it have both the Items and Weapons category and then the sword appeared again. So, I set the Body type to Items and Weapons and when I drag to the slot then it lets it be assigned.
 
Things look like they are working. The default item collection only has an items category so that's why you needed to assign that category instead of weapons.
 
Top