How do I stop the character from shooting when using a certain idle?

I have an archer character with two idles. One with bow ready and one with bow relaxed, and I want to use the bow relaxed when she’s not shooting. When the left mouse is pressed(shooting) she switches to the bow ready and it will look weird, so I need to stop the arrow from spawning(or at least add a delay) in the relaxed position.

The problem is I don’t know how to set up this properly and how to communicate between the character and the animation blueprint. I got as far as adding a boolean in the third person character blueprint and setting it to true when the left moue button is pressed, and false when it’s released. Then I set them in the conditions for switching idles(by using a reference to the character), but I didn’t manage to do something that worked with the shooting action(couldn’t create a working reference to the ABP). Any suggestions?

My animation graph:

Shooting action:

Hello @Unrealist23 ,

you can communicate from your animation to your anim BP, by using anim notify.


You can create it by right click on your notify tab in your animation, and create new notify
image

After then, go to your anim BP, in the event graph, right click and call your notify name.


You can just get your character and call the function to shoot the arrow there. By doing that, your arrow will be spawned when the notify is reached in the animation (Just replace your spawning arrow in leftclick with playing the animation you want).

I don’t think you understand me. I want to stop the arrow from spawning in a certain animation pose, not change an animation when shooting. That is already working. So it needs to include a condition for what idle animation is currently playing, and if idle, don’t shoot.

Try to make a variable like “holdweapons?” and make a branch when you “fire” checking what animation it’s playing.
You can chain different animations in the bp part of your bpa, with condition to switch among them.

since the post I made before isn’t the answer you are looking for, let me clarify what you want first so there won’t be any miss understanding. so what you need is make sure that the arrow only be spawned in the right animation right?

there still some ways to do this, one of them is like Illgib81 said to make a boolean variable to check. You can set the boolean when you switch animation. Example if you are not ready set it to false, if you are ready to shoot set it to true, then before spawning, check that value first.

But if in any way you don’t have a place to set the boolean, you can also use Anim Notify on both of the idle animation. When the notify is triggered in the normal Idle, set the boolean to false, for the readytoshoot animation, when the notify is triggered, just set it to true and check it when you want to spawn. However, this second method may not work based on your implementation.

but also don’t forget to reset the boolean value after shooting.

1 Like