Replace Weapon Idle Animation

SteveC

Member
Ultimate Character Controller, Unity 2017.3.1f1.

Thanks for the upgrade from Third Person Controller, which I loved working with, too... enough to buy this new version when I saw it was out!

I'm having some trouble wrapping my brain around the new system for replacing weapon animations. The models I'm using don't come with animations, in the past making my own animations and using them in Third Person Controller worked really well.

To test adding weapons, I started with the Pistol. Using the Item Manager, I made a new pistol using my own model (AnimatorID=100, no weapon AnimatorController). On the Player I made a copy of the default AnimatorController, and went through each Layer, duplicating everywhere I saw a "Pistol" BlendTree.

First thing I noticed is that, when duplicating ([CTRL] + D) BlendTrees in the Animator (eg. duplicating "Pistol" to make "M1911 Browning Pistol"), the transition from
"Any State" to the blend animations don't copy

1538339158177.png

... so I copied the transitions from the original to look like this:

1538339353687.png

I set the Slot0ItemID=100 and Slot1ItemID!=100. It's not supposed to be a dual wield item, so I don't know if I should remove Slot1ItemID...

Anyways, I made an new idle animation for the pistol to use, and added it to the only place I found a Pistol Idle Animation, the Arm layer:

1538340224641.png

The result is odd... when I hit Play, it looks like it tries to loop the transition from the regular idle animation (arms down) to my weapon idle animation (a semi-aim position).

Thought I'd ask here when I noticed the Animator & AnimatorMonitor scripts were disabled during Play, stuuuumped. I tried enabling them on-the-fly and disabling the IK, but it just gave a different, similar issue... though that was the only time I saw activity occurring in the Animator window.

Not sure what I might be doing wrong to replace the idle animations, and I'd really love to understand the system so I can move on to making additional animations. I know one of the tricks in TPC was to make sure your BlendTree has the same name as the Item. Seems here, the thing to look for is the Slot#ItemID# matches between the Weapon and the Animator... which I think I got right.

Thanks in advance for the help, and for the awesome tools y'all are making!
 
Last edited:
First thing I noticed is that, when duplicating ([CTRL] + D) BlendTrees in the Animator (eg. duplicating "Pistol" to make "M1911 Browning Pistol"), the transition from
"Any State" to the blend animations don't copy
Yeah - this is an annoying Unity bug.

Thought I'd ask here when I noticed the Animator & AnimatorMonitor scripts were disabled during Play, stuuuumped. I tried enabling them on-the-fly and disabling the IK, but it just gave a different, similar issue... though that was the only time I saw activity occurring in the Animator window.
If you enable "Debug Animator Controller" on the Animator Monitor you'll be able to see the graph update.

The animator is definitely more complex in version 2 but it allows for more control overall. Have you seen this page? It gives a pretty good overview of what each parameter/layer does. The name of the state does not matter anymore.
 
Thanks, Justin!

I'll look into Debug Animator Controller on the Animator Monitor and see if I can't track down the issue.

I have read this page , and thanks for having good documentation! It was very insightful, but after following it I still had that problem.

I tried last night with the assault rifle and had the same issue... was wondering if it had something to do w/ Dual Wield.

Anyways, it's temp fixed for now by using the default animation and the non-dominant hand IK & IK settings (thanks for putting that in there!).

I'll post back what I find in DebugAnimatorController.

Thanks again!
 
Thanks for the reply Hodor, I'll check that out. Moved to working on my HUD for a moment, but I'll be back to this issue soon.
 
Top