Weapon stun time

Zaddo

Active member
With this mod you will be able to set a stun time for each weapon. After a successful attack this will play the knock back animation and stun the victim for the duration set on the weapon action.

I couldn't find a way to do this natively with UCC. This is what I came up with. If there is a better way to achieve this, please let me know.

Modification
  1. Add the CharacterVariableKnockBack script to your project. Make sure it exists within the Opsive.UltimateCharacterController assembly
  2. Add a sub-state machine to the base layer of your animation controller (See screen capture)
    1. Set the entry condition to Ability Change and AbilityIndex equals 13
    2. Exit transition should be AbilityIndex not equal to 13
Setup
  1. Add the ImpactKnockBack ability to the character.
    1. Under the Stop event, the Wait For Animation Event should be unchecked. Set the Duration to a default value.
  2. Add the Character Variable Knock Backaction to the generic module of the impact module group for the weapon
    1. Set the Stun Duration on the action
1715488928103.png


1715488676864.png
 

Attachments

Last edited:
Hello!
The script you created worked perfectly. Thank you very much for creating a great one!

Now, I have one question that I don't understand.
What is the “OnAnimatorImpactKnockBackComplete event” you refer to in 2.3 of the “Modification”?
I have not specifically set such an event for an animation I have prepared, but it appears to be working correctly.

I am not very familiar with Unity or UCC functions, so I may have missed something.

I would appreciate your reply. Thanks.
 
Hello!
The script you created worked perfectly. Thank you very much for creating a great one!

Now, I have one question that I don't understand.
What is the “OnAnimatorImpactKnockBackComplete event” you refer to in 2.3 of the “Modification”?
I have not specifically set such an event for an animation I have prepared, but it appears to be working correctly.

I am not very familiar with Unity or UCC functions, so I may have missed something.

I would appreciate your reply. Thanks.
Hey,

I am glad you found this script useful :)

Apologies, I should have removed this as it is not needed. It was a leftover from when I first setup the ability and I was using animation events to end the knock back. I have removed this step from the original post.
 
Hey,

I am glad you found this script useful :)

Apologies, I should have removed this as it is not needed. It was a leftover from when I first setup the ability and I was using animation events to end the knock back. I have removed this step from the original post.
I see, I understand now.
Thank you!
 
Back
Top