|
Post by rafaelartss on Apr 14, 2021 4:19:31 GMT
Hello Goodnight. I would like to know if there is any way to stop the animation of an attack when I activate some other function such as "roll".
Thanks for helping me
|
|
|
Post by Invector on Apr 15, 2021 14:41:46 GMT
You could create a transition from the attack to the state Null and the condition of that transition would be the 'ResetTrigger' parameter... then just set the trigger parameter when rolling
|
|
|
Post by rafaelartss on Apr 16, 2021 0:21:40 GMT
You could create a transition from the attack to the state Null and the condition of that transition would be the 'ResetTrigger' parameter... then just set the trigger parameter when rolling Hi, Thanks. I think I do not understand. Is it to do as in the image? It's not working. I wanted it to be possible to stop the attack animation when I move or roll. Making combat smoother and more dynamic. Thank you for your time and attention.
|
|
|
Post by Invector on Apr 16, 2021 13:20:19 GMT
I'm not sure that interrupting the attack when moving is a good idea, most of the time the player will be moving while pressing the attack button. A way to reduce transitions is to create a single transition from AnyState to Null and adding the parameters I was talking about the ResetState parameter, already included on the Animator... you just need to call via code, for example, in the Roll Method add the line: animator.SetTrigger("ResetTrigger");
|
|
|
Post by Invector on Sept 1, 2021 14:38:11 GMT
I'm not sure that interrupting the attack when moving is a good idea, most of the time the player will be moving while pressing the attack button. A way to reduce transitions is to create a single transition from AnyState to Null and adding the parameters I was talking about the ResetState parameter, already included on the Animator... you just need to call via code, for example, in the Roll Method add the line: animator.SetTrigger("ResetTrigger"); You mentioned setting a transition from the attack to the null state but in the image I'm not seeing that. Am I setting a transition straight from the Weak/Heavy sub-state to null like this? or should I be going from the attack anim itself (A - Z) somewhere? How does this look from the attack pov. I've tried playing with the interruptions telling it to go to null, ive placed the animator.SetTrigger("ResetTrigger"); right under isRolling true, nothing working for me. Plz help, got an error for animator.SetTrigger("ResetTrigger") should this be animator.SetTrigger("ResetState")? It didn't give me errors when i changed it, or should I be creating a new parameter? As I mentioned in the previous post, no need to create lots of transitions, you can use the AnyState to Null and the correct parameter is ResetState not ResetTrigger
|
|
|
Post by jrx818 on Sept 21, 2021 19:36:59 GMT
I figured something out that worked for me. It may take a little more testing but it seems to work great now. In the vMeleeCombatInput.cs script under "protected override bool RollConditions()", there was specifically a condition saying if the player "isAttacking" you can't roll. I removed that and Presto! Hoping it doesn't lead to other issues but initial tests seem good.
|
|