My secondary weapon never gets activated

konig6

New member
Hello there. I recently purchased the UCC pack, and I'm feeling a bit overwhelmed, not going to lie. I am aware of its full potential, that's why I really want to dig into it.

I'm following this basic tutorial:

I've setup two weapons: an Assault rifle for the right hand, and a Bow for the left hand.

I start the game with the Assault rifle equipped. When I press "T" (which I think is the key to switch weapons), the Bow (Item Set 1) doesn't get activated. I made a video to clarify my situation (apologies for the background annoying noise; turn off speakers):


Any help will be greatly appreciated. Thank you!
 
It looks like you got the assault rifle equipping so that's a good start. If you add another right handed weapon such as the shotgun can you get it working?

Beyond that there are a series of troubleshooting tips to help pinpoint why the item isn't being equipped. Take a look at the top of this page:

 
Thank you for your answer Justin.

I've tried with a Shotgun, but the result is still the same. I'd like to point out that if I start the game with the Bow instead of the Shotgun, the problem still persists. I made a new video on this (let's ignore the fact that my bow's offset pos & rot are completely messed up, I know how to solve that):



As for the link you pointed me to, I will give it a read and see if I can solve it on my own.
 
Instead of trying to switch from the shotgun to the bow, try to switch from the assault rifle to the shotgun. In a lot of cases the issue relates to the animation event not being sent, and this can be tested by disabling animation events on the Equip Animation Event Trigger but instead use a timer.
 
Tried switching Assault Rifle to Shotgun, still no success.

Following the link you pointed me to, in step 2 it says "The Equip Unequip ability exists and has an Item Set Category set to the same category as what the Item Type belongs to. "

In my case, the Equip Unequip ability is inside of "Item Abilities" (not inside of Abilities), and its ItemSet Category is set to Items, see my screenshot.

213523d4f.JPG
 
That looks correct. If you upload just your scene I can take a quick look instead of going back and forth. I only need your scene since you are using the built in assets.
 
Thanks. It doesn't look like the shotgun was in that original scene but I figured out why the bow wasn't equipping. On the Equip Animation Event Trigger if you disable Wait for Animation Event then it will use a timer instead of the animation event.

1585153312766.png

The reason this happens is because when the assault rifle is unequipped the arms are disabled because there is no item equipped. You then want to enable the bow, but because the arms are disabled the animator is also disabled and you will never receive the animation event. By using a timer instead of an animation event it'll correctly equip the item.
 
Did you try it out? Because I unchecked that checkbox and the thing still doesn't work. You didn't make any other changes, did you?

Apologies for insisting too much. This is basic stuff and have to get it working before continuing studying UCC more in-depth.
 
Yes, I did try it out. Setting the Equip event was the key. Here's the scene that I used. The only other changes that I made was assigning the ItemTypes because I didn't have the metadata files which is how Unity references the objects.

It makes sense why this is happening - you aren't using a full body animator so that's why it doesn't work as it does in the video.
 
I will start over from scratch, now that I know that thing about the animator. I will reach you back with my results. Anyway, your scene isn't working for me (the checkbox isn't even unchecked!).

Let me try again and I will post the results.

Note: Maybe what I'm doing wrong is not assigning a Character GameObject (see picture). For some context, I'm building a low-poly mobile FPS (first person) where I don't need the body parts (not even for holding weapons; just like if weapons were "floating" in the air, giving it a nice look).

c2323dq3d.JPG

Grateful for your time and help.
 
Good news Justin. It was indeed the Animation Event option that needed to be disabled. For some reason it worked by closing and opening Unity back up.

The important takeaway here (for others in my situation) is the comment Justin made above:

The reason this happens is because when the assault rifle is unequipped the arms are disabled because there is no item equipped. You then want to enable the bow, but because the arms are disabled the animator is also disabled and you will never receive the animation event. By using a timer instead of an animation event it'll correctly equip the item.

Marking as solved. Thank you again!
 
Top