Setting up left & right handed items

Hamesh

Member
I am trying to setup a few different pickup variations for the same item type. I need a pick up where the sword will be equipped into the right hand and then another which will equip it into the left hand. The right I have managed to get working, however when I duplicate and edit the pick up gameobject for the left hand the item is not equipping at all. When creating the left hand item I have followed the exact same steps in the item manager as of the right hand, except changed the slot id to 1. I also noticed that the Third Person Perspective Item component on the left hand item gameobject had the Parent Humanoid Bone set to right hand instead of left (despite the slot id being 1) by default, so I changed this. Below are the settings I am using:

Item Manager
1586672740315.png

Item Gameobject
1586672868829.png

Item Set Manager
1586672914859.png
 
Last edited:
These pages should help:


You'll need an item for each slot, and your Item Set 3 looks good.
 
You'll need an item for each slot, and your Item Set 3 looks good.

Yes I have gone through this one and the Item Set page, but I though that this is what I have done already? Since Item Set 1 above covers the sword in slot 0, while Item Set 2 covers the sword in slot 1 or have I done this incorrectly? I have also looked at how the bow and shields are setup since these are both left hand items as well, but I cannot see any differences to mine.

Below is a screenshot from the actual left hand sword pickup, which when entering the trigger it does add the item to the left hand but then deactivates it and the input doesn't trigger any of the sword animations. The only other thing I can think of is do items that can be equipped in the left hand by themselves need to be a separate item type to the right hand version?

1586774774620.png
 
The only other thing I can think of is do items that can be equipped in the left hand by themselves need to be a separate item type to the right hand version?
No, they don't. Have you gotten the left hand sword working without trying to dual wield? If not then it's one of these items under the troubleshooting section:


Version 2.2 has more help boxes indicating if something is setup incorrectly so I would also update to that to see if that helps.
 
Ok are you able to let me know which component the Equip Unequip ability is on since that is the only troubleshooting step I haven't been able to try. If I uncheck the Wait For Animation property of the Equip Event this does make the item visible and play the equipping sound, but the animations still don't play on input.

Once I tried that last step I will go ahead and give the update a try. I have also made changes to the animator and copied all of the right arm sword states over to the left arm layers, but I would assume that that would be necessary and not cause the issues I am experiencing? Although I did test the pick up before making the animator changes and it also did not work, hence why I made the changes.
 
The Equip Unequip ability is on the Ultimate Character Locomotion component. For version 2.2 I would start by getting the exact setup as this video and then you can go from there:


Once you have a sword and shield setup independently on each slot you can just create a new ItemSet and they both will be equipped.
 
I have checked the Equip Unequip ability and these were all also correct and as per demo Nolan so I'm not sure why it wasn't working.

With the 2.2 version, I have tried importing everything from scratch but despite not upgrading but actually importing everything fresh I still had the same issue as in the upgrade video. Shouldn't these steps only ne necessary for an upgrade not a fresh import? After I did the installation I followed all of the steps in the video but when done I am getting a whole bunch of null reference errors in the default demo scene. I have setup a few of the items in the Item Set Manager but not all yet. Could this be why the errors are happening, they appear when simulating the game at the 1st/3rd person selection screen?

1587118359068.png
 
Last edited:
It looks like the item category that you are using isn't valid for the ItemSetManager. You could try reassigning your ItemCollection or just to get things working use the built in ItemCollection.
 
Yes I am using the default ItemCollection that came with the demo, and I created a single category called Items as per the video, please see here:

1587130525456.png
 
You don't need to create a new category if you are using the DemoItemCollection - it already has the category created. This would then explain the mismatch.
 
Sorry do you mean that the category is already built in to the item collection? Since other than Items there was no other category there originally. I created the category based on the video since I was getting the null reference errors and thought that creating it would fix this issue. I have just gone ahead and deleted the Items category and the null reference errors are still there. So what exactly should I do to fix this?

Edit: I also just realized that when Nolan is selected in the editor (without simulating game) and I scroll through the components the null reference errors also start to appear.
 
Last edited:
Can you can reproduce it within the demo scene I can take a look? My guess is that there is some type of a configuration error. Just to ensure you're using the right workflow, have you gone through the videos from a fresh project? The videos were updated for 2.2 so you should be able to follow along exactly as I do in those videos and get the exact same results.
 
Yes it is happening in the default demo scene in a fresh project. The only thing different to in the 2.2 videos is that I also have Behavior Designer and the Swimming and Agility Addons also in the project, but this should matter should it?

I will delete everything in the project and start again from scratch by importing all of the packages again. Hopefully this will get rid of the errors.
 
Ok I have removed BD and UCC from my default project. I then imported these from the asset store, tried the UCC demo and everything was working ok out of the box, I didn't need to create the item categories or update the item set manager, everything was ready to go.

I then followed the same steps in my dev project. I removed BD and UCC as well and followed the video step by step. After installation I tried the UCC demo scene and got all sorts of errors (mainly null references for many different components). I continued through the video and set up the item categories and some of the initial item sets. I tested the demo scene again but still was getting all sorts of errors (again mainly null references for many different components). Do I need to set up all of the item sets for every weapon for the demo scene to not have errors, or only those that will be picked up?

I then tried to use my own scene (same dev project as para above) since the character there has much fewer items and they are all runtime items. However when I select the character in the editor it takes a while before the inspector shows up and then Unity completely freezes. I have tried this several times and each time it freezes. I will try to delete the character and create it again tomorrow, but other than that is there anything else I can try?
 
If you are getting exceptions you'll want to stop and correct those exceptions before continuing.
Do I need to set up all of the item sets for every weapon for the demo scene to not have errors, or only those that will be picked up?
No. For the video I created a new item collection and was just using that. You'll want to go through the videos in sequential order. In these videos I only have one or two items so you should be able to follow along directly.

 
Yes I will try creating the custom character again, but what I'm confused about is why is the demo scene not working in one project and working fine in another? Especially when the steps I have taken to import everything are the same.
 
Top