How to setup the body to be default and work with weapons?

I updated the documentation with a small section on how to add a body Item:
Hopefully it helps

Yes, my character not dying only happens the body is attached.
That's very odd, I can't think of any reason equipping an item would prevent the character from dying other than if there was an error. Or if the animation events were not set or the animation was stuck in a certain ability.

Ive already checked the package i sent you previously. there should be nothing wrong. I explained in my prior response to you the scene name was different.
I did try out this scene, but as I mentioned before there are issues with missing scripts, missing abilities and other issues which are preventing me from testing it.
1632842614908.png
Make sure to test out the scene package before sending it again.

Furthermore, What do you mean setup colliders, there are no coilliders on the demo object in the third person melee properties script? All of those fields are empty. And when i tried dragging my colliders to the body object, the script wouldn't let me. No errors in the console
As mentioned a few posts earlier, Hitbox colliders are set at runtime using IDs. I made sure to reiterate that in the new documentation. The option to set the Hitbox collider ID appears once you click on an element in that list (refer to the screen shot I sent you a few post earlier). ObjectIdentifier components are used to define the hitbox collider. If you are confused about what are ObjectIdentifier please refer to the documenation and the UCC video tutorial about runtime Item Pickups.
 
I updated the documentation with a small section on how to add a body Item:
Hopefully it helps


That's very odd, I can't think of any reason equipping an item would prevent the character from dying other than if there was an error. Or if the animation events were not set or the animation was stuck in a certain ability.


I did try out this scene, but as I mentioned before there are issues with missing scripts, missing abilities and other issues which are preventing me from testing it.
View attachment 7306
Make sure to test out the scene package before sending it again.


As mentioned a few posts earlier, Hitbox colliders are set at runtime using IDs. I made sure to reiterate that in the new documentation. The option to set the Hitbox collider ID appears once you click on an element in that list (refer to the screen shot I sent you a few post earlier). ObjectIdentifier components are used to define the hitbox collider. If you are confused about what are ObjectIdentifier please refer to the documenation and the UCC video tutorial about runtime Item Pickups.

Im following your documentation, however I am quite confused on steps 6 and 7 of the "Create Body Item Steps" section. Everything that you mention in both of these two steps are already setup and configured by default. Additionally, I dont know what you mean by "renamed your weapon equipment item collection to “Equippable Slots”" in step 6. The item collections I have are Main(default), Equippable slots, Equippable, and Loadout.
 

Attachments

  • collections.PNG
    collections.PNG
    25.8 KB · Views: 1
I have followed every step and the character still cant do a melee attack. Ive checked the melee body script and it now matches the demo body script. I have set the object colliders on the runtime prefab. But the character does nothing when i try a melee attack, however, my character can still do everything else now.

I have uploaded my project to my google drive acct. I have emailed you with the link to the package. I have opened and tested the package in a new Unity scene in URP. The only thing you might have to do is update the project layers and buttons for UCC and UIS.
The scene name is "BodySetup" and it is located in the _scenes folder.
 
Hi ubailey

Once again the scene you sent me has scripts missing and errors unrelated to your issue. The next time you sent us your package please make sure to enter play mode in your scene and test it such that it reproduces just the error you are having in your project.

After fixing some of the unrelated problems with your package, I was able to see an error messge which seems related to your problem.

"Error: Unable to initialize Body31(Clone). Ensure the weapon has a collider."


You said you had setup the colliders, but that doesn't seem to be the case. I see you've set some Colliders ID on your Melee Weapon properties

mkFUGP9xEyQxyKXH8MWFRqD3V


But that ID is nowhere to be found on your character hierarchy. You need to add a Collider on your character and add an Object Identifier component with a matching ID. For example I added this one:

GZFWyYhSzrj5GB4tC0Xjs9XhA




Also the IDs must be Unique, so we recommend you use IDs with more numbers. Usually IDs 1-100 are already taken for certain abilities in the system. So for body Item we recommend you use something similar to what we use in the demo scene "2101", "2102", etc...



Another problem I found is that you have the Body Item equipped twice

O84wPnsnHpzAU7GgogdVuMdHs


In the documentation I explain clearly that your Item Set Rules must be exclusive to avoid this. Here you get two Body Item Sets because Item Set Rule 0 and Item Set Rule 1 are both creating a body Item Set. That's because Body inherits both the Equippable and the Body ItemCategory.

Change the Item Set Rule 0 category to something more precise such as Weapon, or Blade or Shootable Weapon, etc..


Additionally when using an item its good practice to set the ID of the slot your input will use. In your case you want to use slot 0 with click to attack.

5OZxWenVA0zLVBZBsen8p4lcE



Then I tested your scene and saw that the character was stuck in the equipping state. The item ability was always active

6x4I9BWn1rRmBL5geJtxssEHG



Looking at the body Item I saw you were waiting for an animation event that does not exist. Here I changed it such that it doesn't wait.

27Dj1zPXaClA0biPjfC73SsHd




If you refer to the Body Item Prefab in the demo scene you'll see that that's how it is setup.



And that seems to fix your issue and the character can attack.

When debugging something that goes wrong you should always check the abilities and the animator to see if the character is stuck somewhere waiting for an event.

Always compare your prefabs with the ones from the demo scene to see what are the differences. We recommend you have a seperate Unity project with only the Opsive packages installed such that you can refer to it and put side by side when you have a problem.



I hope this explanation and guide on how I debugged your issue and fixed will help you fix your bugs on your own such that you do not have to wait for us to fix your project.
 
That sounds like the old link. Maybe Google drive was still linking to the old file since both files had the same name. Anyway, I have totally deleted the old copy and reuploaded the correct copy with a different name. The package works as I was able to import and go directly to _scenes> BodySetup.I have attached a screenshot of me inside of the scene in Play mode with the correct directory for the scene showing in the project window.
 
Last edited by a moderator:
Top