I am working on a third person project on my own and I am learning about character animation. I have a character and an animation montage called “Shooting.” I want this montage to repeat for as long as a certain button is pressed (In this case, the left mouse button). I have a bool called “IsShooting” that is true when the left mouse button is pressed, and is changed to false when it is released. I am trying to use a while loop to play the animation montage until the “IsShooting” variable turns to false. I think I am suppose to alter the variable somewhere inside the Loop Body of the while loop because currently, every time I click the left mouse button in Play, everything freezes and I have to restart UE4. However, I do not know how to change the variable inside the Loop Body as I am doing it based on the press and release of the left mouse button. Here is what it looks like:
This is a montage for shooting obviously. Right now, I am trying to get it to work but later I will have to have a condition that stops the animation based on the number of ammo left. I have no idea how to do this either so if anyone has worked with something like this, please let me know.