Change animation blueprint variable
I am very new using UE4 (my first week learning). I am very confused between what goes to C++ and to the Blueprint editor and how are related between each two.
So, I have started a c++ top down project. I have setup a character "behaviour" from idle -> walking -> to running through blueprint event and animation graph.
So I have basically 2 variables, which are speed and isAttacking.
The speed works more o less good, since is the tutorial I find everywhere, but I did instead of a blended animation, just as separated animations to see if I managed although for what I read is not the best way (learning purposes!). Sometimes the animation gets stuck in the run, but if i debug the graph works good the graph, so I hope is only a visual thing of the editor, but thing for another moment! :)
Also in the c++ part is done by default when you create the project.
So then I have mapped in the settings/input, that when you press A key, you "should attack". The idea is to move from idle to attacking state when "isAttacking is true", and go back when the attacking animation is almost finished.
I have created the following code in the c++ part:
So I have setup the OnAttack function, that is bound to the "Attack" input key "A".
But in here I am totally stuck. If I press A, certainly appears hello on the screen, but I don't know if in here I should set the variable "isAttacking" to true (and if so, i don't know how to access to it), and when the key A is released then set to false. Or I am doing to much and it's not necessary to do this like that because maybe I can do from the editor directly...
Also I don't have very clear where is the line between to add stuff in c++ and into blueprints (or if I can combine them, like trivial easy things in blueprints and more complex things in c++), and neither in how they are connected (c++ with the blueprint editor). I think this is the part that I'm the most confused right now.
I hope I could post clear, since I am also learning the terminology and probably I name things wrong :P
Thanks a lot for your time.
asked Sep 25 '16 at 12:35 PM in Using UE4
Defaiantly you need to set "isAttacking" to true while attacking and then reset it to false by the end of the animation. ABout the how to do it, so let me ask you first where is the "isAttacking" variable is?
If not clear, let me know.
answered Sep 25 '16 at 12:59 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here