Problem with animation, bool won't change to false...

Ultramarus

New member
Hello! When I set the animation using the behavior designer, it does not change the parameter at the end, in the animation in the last frame there is an event with a change in this parameter. If I do everything through a script and do not use the behavior designer, then everything works fine...
You can see my problem in the next video:
 
Have you tried placing a breakpoint to see if the code executes when you expect the animator to be set to false? I don't really see your tree but it's likely a logic issue related to a task not running when you think it should.
 
Снимок экрана 2023-08-14 204949.png
Same animation have problem with change bool parametr to false...
Last animation frame have event with disable. This metod work when i'm not using BD, but when bd using, animation stoping on the last frame...
BoxColider stay disabled, but animation bool parametr "Attack" does not changed to false, always stay true...
In the video, you can see that the animation stops at the last frame.
 
What does the state of your tree look like when you expect it to change? Does the task execute?
 
All tasks completed, but the animation event does not change the parameter...
I don't really understand why... If I use animation through script, then everything works...bandicam 2023-08-15 20-47-11-978.jpgbandicam 2023-08-15 20-45-37-058.jpg
 
Behavior Designer doesn't have any control over the animator so something must not be called that is being called when you do it through code. I see a DeactivateAnimationAttack method but I don't see where that's being called from within the task.
 
AttackTargetCharacter will enable your attack but I don't see anywhere that you are calling DeactivateAnimationAttack within the behavior tree.
 
It is not called in the behavior tree, it is called in animation events. do I need to call it in the behavior tree, calculate the length of the animation, and call it at the end? Or check the state of the animation?
Sorry I can't write during the day, I'm usually at work until the evening...
 
Ah, you should be able to use animation events. I use them heavily with the Ultimate Character Controller. So DeactivateAnimationAttack does get called? Maybe the AttackTargetCharacter task is running immediately after the animation event so that's why it appears that it never gets set. If you place some logs next to setting the animator parameter you should have a better idea of the flow.
 
Thank you! And yeah, "AttackTargetCharacter task is running immediately after the animation event" then I add IEnumerator "Cooldown" and now maybe is ok...
 
Top