Melee body item doesn't work until another item is equipped.

DavidC

Active member
2020.3.4f1 (also tried x.7f1)
UCC 2.3.2
UIS 1.1.7
UMA, Digger Pro, A*

Basically, this is the demo scene, except I've replaced Nolan with a dynamic UMA. I've added a bit of terrain, and A*, which I can't imagine affects anything. The Controller is from the demo, the avatar is per the UMA integration document. The UMA should have all the same exact Slot IDs and Object IDs as Nolan. No errors or warnings are being logged. Sometimes it seems like I cannot Jump until I switch weapons, other times it seems to work just fine.

Settings I've changed:
RB - Continuous
Root Motion - disabled
Update - Late Update
FP/3rdP- Combat

Not that you can tell, but at the beginning of the video I'm clicking...


1621525472425.png

1621525479973.png
 
1621525940750.png

Note: I renamed the weapon object prefab to "fists" but otherwise it's identical to "body."

Code:
public override bool CanUseItem(ItemAbility itemAbility, UseAbilityState abilityState)
        {
            if (!base.CanUseItem(itemAbility, abilityState)) {
                Debug.Log("Cannot Use Item " + this);
                return false;
            }
            Debug.Log("Can Use Item" + this);
 
humm... I wonder if the issue comes from the UMA integration. We haven't implemented an integration between UIS and UMA so that might be it, but I can't think of a reason why.
Perhaps the Item is Equipped before the UMA character is initialized?

Another guess would be that the animator is stuck in state because of an animation event, but if you are using the default animator I can't think of a reason it wouldn't work

Clearly your body Item says that it can be used.

Could you have a look at your Character/Item abilites at runtime to see which one is active the first time the body is equipped? And whether some get activated when you try to attack.

Feel free to send us your project by email at support@opsive.com such that we can look into this in more detail
 
Thanks for sending your project. Going through it I found that the issue was caused by UMA.

The issue is that the Animator parameters are reset by the "Dynamic Character Avatar" on start. The UIS Inventory loads the Items that you've set in the Inventory inspector within the Item Collections during awake. The bridge listens to the event and equips the item, during awake.
Making the change to equip items during start will be complicated and could break a lot of things, so I would prefer avoiding that as much as possible.

So you have two options.
1) Contact the UMA devs and let them know that they should save all the Animator Controller parameter values before replacing the Animator Controller such that they can load them if possible.

2) Instead of setting the item directly in the Equippable Item Collection you could set it somewhere else (another Item Collection or invnetory) and then move it during start or on the first frame of the game. That should equip the item after UMA finished doing its thing.

I would highly suggest going with option one as that could potentially fix other issues.
 
Top