NullReferenceException - Get Active Item Set

Klin

Member
Hi,

I created a new character with an Item and set it up as usuall but I get the following error when hitting play.
1647988589561.png

Code:
        public ItemSet GetActiveItemSet(int categoryIndex)
        {
            var activeItemSetIndex = m_ActiveItemSetIndex[categoryIndex];

            if (activeItemSetIndex == -1) { return null;}

            return m_CategoryItemSets[categoryIndex].ItemSetList[activeItemSetIndex];
        }

In Line 704 m_ActiveItemSetIndex is null.

Nevertheless, the character is being spawned and the item is being equipped correctly, displayed as active in the ItemSetManager and it seems everything is working fine except this error msg.
I get the exact same error msg also when I spawn the character without any items at all.

I tried the usual stuff - restarting, recreating - no success.

Any ideas here?

Thanks for helping out!
 
When you have an error message please send the entire log. It's important to know what was the root call for this function call.
By any chance do you have the character inspector selected when you press play?
 
Sure sorry missed that:
1648057497104.png

I get the error msg regardless of wheather the inspector is open or not.
 
From you error message it seems that the error happened because of script execution order.
PG_AIComponent (This script is no an Opsive script) called a function that ended up calling something in ItemSetManager event though it was not yet initialized. So if the error appears again try changing the script execution order in the project settings
 
Top