Third Person Controller + Inventory Integration Becoming an all out Nightmare

Hi,

So I've had the Third Person Controller for a while now and although the learning curve was tough and the documentation isn't all that helpful, unless everything just falls into place and works, I'm making some good progress with the controller itself and I'm very happy with it.

However, I decided to give the Inventory system a try and integrate it with the Third Person Controller. Honestly, so far it's just a mess. A terrible mess. I'm almost 99% sure it's something I'm missing or doing wrong, I hope. But at the same time the documentation isn't very helpful and I'm pretty lost to be honest.

Just for reference I am making a third person shooter game, using HDRP and Unity 2019.4.8;

So I have the Third Person Controller updated to 2.2.7 with the Ultimate Inventory System 1.1.3. I've watched the videos and followed the integration documentation and setup my TPC character and have the UI working in the scene. I duplicated the EmptyDatabase and classic schema. My problems are actually getting any of the weapons to work or show up or do anything. I'm continually getting errors that I can't find solutions to. So I have a few questions that I can't find answers to. (These weapons were all working great with the controller just to clarify).

First, I have all of my weapons, with their item type and definitions for the Third Person Controller set up and working. Now that I have the inventory system do I just delete all of these definitions and item types and replace them with new categories and def's in the inventory system? Or is there a way to transfer them without having to redo everything? I've remade them in the inventory and tried removing my controller's item collection and nothing really worked.

Second, the inventory demo character as well as the character in the tutorial videos does not have the "Items" on the player character anymore, since apparently they are created at run time? So does this mean I have to delete the Items for my player, both the third person visible objects (parented to the "Items" on the armature with the "perspective components" scripts) as well as the actual Items prefabs on the player gameobject (with the shootable weapon properties and other components on them).
- Does this mean I'll lose the prefabs? Also ties into having to re-create everything.

Third, I'm completely confused about which scripts to attach to the weapons (item object, item object identifier, item object handler etc...). The demo scene has item object scripts on the usable weapons so I put that script on my guns but I'm not even sure if that is right. I've created item categories for weapons and equippable? I've also created definitions for each of my guns and the bullets, bullets are under the consumable category. I've assigned prefabs to the gameobject prefab attribute, at least I think that's what I've done.

Anyways I'm pretty frustrated with the lack of documentation for taking an already made and working PlayerCharacter from Third Person Controller and integrating it with the UIS. The videos are on how to setup a brand new scene with a completely empty character and create everything from scratch in a clean project and everything just works perfectly. But that's not really realistic and it's been two days of googling and wondering how the hell anyone gets this to work.

Anyways, the Third Person Controller is great as is anything else the opsive team seams to make so I'm excited to get this inventory system working.

Thanks.
 
Last edited:
I will look into improving the documentation for the integration at some point since a few people seem to have troubles when first getting started.

Just to be sure since it wasn't clear in your question, have you had a look at the integration demo in
Assets\Opsive\UltimateCharacterController\Integrations\UltimateInventorySystem\Demo

In Assets\Opsive\UltimateCharacterController\Integrations\UltimateInventorySystem\Demo\Prefabs\Items
You'll find the how the prefabs are setup. You'll see that they are setup exactly the same as for a pure UCC(TPC) item.
Sometimes they have additional components like the ItemBinding script on the Assault Riffle, that is optional. It simply lets you bind Item Attribute values to the actual ShootableWeapon component properties.

1)
You cannot transfer UCC ItemTypes to UIS ItemDefinitions because they are not exactly the same thing.
You'll need to create the UIS ItemDefinitions manually making sure they use the correct category. The EmptyDatabase you Dupplicated should have all the required categories to make the integration work. You can refer to the IntegrationDemoInventoryDatabase to get a better idea on how you can organize your ItemCategories and ItemDefinitions.

Make sure your character is setup to use the integration correctly. You'll know it is the case if the Bridge is correctly referencing the ItemCategories of your database:
1610008975070.png

2)
Yes the items are added at runtime to the player.
You shouldn't remove the prefabs from the project, just from the player.
You'll use the prefabs to spawn the item under the player at runtime. Those prefabs are referenced by the ItemDefinition as an Attribute
1610009265724.png
Make sure to read this page https://opsive.com/support/documentation/ultimate-character-controller/items/runtime-pickup/
Especially the part with the Object Identifier as you might need it in case your item needs to reference something on your player or another item once it is spawned on the player.

3)
I think I answered this question above. Your Item prefabs don't need to any new components, they can be the exact same you used for your pure TPC project.
The ItemObject, etc... components are added at runtime when the prefab is instantiated under the player. This is done automatically by the bridge component.


I hope this clarifies some of your questions. If you have any other questions do not hesitate to ask.
 
So I've had the Third Person Controller for a while now and although the learning curve was tough and the documentation isn't all that helpful, unless everything just falls into place and works, I'm making some good progress with the controller itself and I'm very happy with it.
Glad things are going better. Can you give some examples of things that you'd like to see in the documentation?

Hopefully Santiago was able to help clear some things up, but the inventory system requires all items to be a runtime pickup item instead of placed on the character at edit time. The character controller doesn't include an editor which allows you to convert items added to the character into runtime pickup items though this is a good idea. For right now the fastest way to convert an existing item is to do the following:

- Create a new item by following the runtime pickup/inventory system integration videos. You can easily switch this out later but since you are creating a new item you should use the item definition from the inventory system.
- Copy the Item/ShootableWeapon/MeleeWeapon component from the item on your character to the new runtime item. Since you copied the Item component you'll need to set the item definition again.
- Delete the item from your character using the Character Manager.

From here it should then work like the video.
 
Thank you both for the replies, this clears up a few things for me and I'm making some progress now.
@Justin I was going to ask if everything needed to be a run time pick up so thanks for mentioning that.

Things I would have liked to see in the documentation are just what I was struggling with in the original post.

The quick start video for the inventory system, the one with Justin narrating, states that the new character being created does not need the "Items" prefabs bound to a specific player since they are added at runtime. This implies that the "Items" object parented to the playercharacter for the Controller don't need to be there, but it doesn't directly tell you how to go about doing that with a controller character that already has everything on it.

I guess what I needed was someone to literally lay it out step by step and explain it. I realize that the videos do imply this and we should be able to learn from that but sometimes when you're in the mentality of learning something new you just need it laid out in a straight forward way because it's hard to just be like "Oh I guess I'll just delete everything I've built and have been using for the last few months and that should work". Even though this is exactly what worked, sometimes you just need to be told "It'll be ok so just do this".
 
Last edited:
Top