Help with Inventory Identifier

snicker

Member
UIS 1.1.5

Hi, I am getting these warnings and errors from inventory identifier and inventory manager. I have 1 of my player character with inventory and many prefab duplicates of enemy AIs with inventory spawning at runtime in the scene. I have tried 'update scene' on inventory system manager and it gives a repeating error as long as the inspector is open on the Opsive 'Game' object.

How do I make each sequential duplicate spawned +1 for their inventory identifier ID?
The warning says its finding a duplicate ID for my player character too but there is only one in the scene.
 

Attachments

  • ProceduralDungeonProject - Death_Valley - PC, Mac & Linux Standalone - Unity 2019.4.21f1 Perso...png
    ProceduralDungeonProject - Death_Valley - PC, Mac & Linux Standalone - Unity 2019.4.21f1 Perso...png
    99.9 KB · Views: 9
  • 1615403317350.png
    1615403317350.png
    211.4 KB · Views: 7
I personally wouldn't use Inventory Identifiers on enemies.
The goal of an Inventory Identifier is to easily find the player component from anywhere, especially the UI. Some games can have multiple players each with thier own UI.

If for some reason you really need the Inventory Identifier on enemies, a solution is to spawn them disabled, change the ID to whatever you want and then enabling them.
 
My mistake, I thought it was a required component for UIS. Deleted the component and it works.

I am still getting the console warning of duplicate ID of 0 from my PlayerCharacter when its the only one in the scene with inventory id on start.

I'm trying to understand UIS required components, my enemies also have Item User and Unity Input which I'm not using but it causes errors when I remove them - these are behavior designer / UCC / UIS characters so as far as I know they don't need an input component except to prevent the null reference exception on Item User's input field.
 
There must be a second InventoryIdentifier in your scene or something that forces it to register twice. Try adding a break point or a Debug.Log in the Inventory Object Register (where you are getting the dupplicate warning) and in the Awake or Start function of the InventoryIdentifier.
Then try to find where those calls are coming from and from what Gameobject. That might help you find the issue.

As for the null reference when removing the UnityInput field, could you share the error. I don't see where it could be coming from
 
After removing inventory identifiers from my enemy prefab I could safely remove unity input and item user without null reference from inventory interactor.
 
Top