How to effectively play an animation on click?
K im making a character that will play a swing animation on left click, i set a bool to true that is used in the animblueprint to start the transition to the swing anim, once the ratio of the anims completion is less than 0.2 i transition back to the idle anim. once completely i set the bool to false so that it wont cycle back into the attack anim.... this works.
but... ive noticed a delay, i small window of time where the swing animation is finishing up (probably within that 0.2 ratio) so obviously the bool is false at this time, so if i click at this particular time it sets it to true and it does the other functionality of the swing attack but doesnt play the animation because the previous animation is not finished yet.
when setting the ratio completed check to 0.05 it stays in the attack state indefinetly, if i trigger the setting of the bool off of the "END" of the transition it stays at the last frame of the anim and never goes to the idle state.
has anyone made a fool proof click triggered animation? am i doing this just horribly wrong or what?
asked Apr 23 '14 at 06:23 AM in Blueprint Scripting
You may want to try using an AnimMontage for your swing animation. It will allow you to take all of that logic out of your state machine and basically just play your swing animation over whatever else is happening. There's a pretty thorough tutorial for setting up an attack using montages in the documentation here: LINK. Note, in that example, they are setting up the animation to only play on the character's upper body, but you can just as easily play the montage on the character's entire body by not filtering the output of the Slot node with a LayeredBlendPerBone.
Good luck, and just yell if you have any other questions/issues.
answered Apr 23 '14 at 02:25 PM
Ray Arnett STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here