# Player can spam arrows, any fix?

**URL:** <https://forums.unrealengine.com/t/player-can-spam-arrows-any-fix/475030>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [November 26, 2020, 2:27pm UTC](https://forums.unrealengine.com/t/player-can-spam-arrows-any-fix/475030 "2020-11-26T14:27:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iNeptuno](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ineptuno/32/1036386_2.png) [@iNeptuno](https://forums.unrealengine.com/u/iNeptuno)\
**Post date:** [November 26, 2020, 2:27pm UTC](https://forums.unrealengine.com/t/player-can-spam-arrows-any-fix/475030/1 "2020-11-26T14:27:18Z")

</div>

Hi!

I’ve been trying to fix this since a long time, but I can’t find a solution. I’ve tried with the _ **DoOnce** _ node and the _ **Timer by Event** _, but it didn’t work (maybe I did something wrong). How would you prevent the arrows to be spammed? I’ll add S.S so you can see what I did.

 ![323147-2020-11-26-11-22-04-window.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/6/a/c6a3a1b3928cb5f5db9624366b7fa9531e8b5b10.png)

 ![323148-2020-11-26-11-23-10-window.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/2/b52faff5fe922714d07c3850e813c2c8fe8c12bf.png)

 ![323149-2020-11-26-11-24-24-window.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/3/7934b5413419896e086052748cf0620a7d86827c.png)

 ![323161-2020-11-26-11-25-13-window.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/8/0/3808390c7e40a911ab9ef8d2ee60d2edbac2a5bd.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 26, 2020, 2:56pm UTC](https://forums.unrealengine.com/t/player-can-spam-arrows-any-fix/475030/2 "2020-11-26T14:56:38Z")

</div>

DoOnce is the way. Put one on each line after the InputActionFire. Then either have a loopback or a custom even on the reset. Only reset it when you’re happy for them to fire again…

Although I’d separate this:

![323162-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/1/d5121f1649c3a5f30c3d0f2763a0e563c4451ab1.jpeg)

Keep the execution line apart.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [November 26, 2020, 4:21pm UTC](https://forums.unrealengine.com/t/player-can-spam-arrows-any-fix/475030/3 "2020-11-26T16:21:12Z")

</div>

Here’s how I handle it.

The input action (Fire) checks against isFiring? bool before calling the event.

[](https://i.imgur.com/gtTlcuW.jpg)

---

<div class="post-metadata">

**Author:** ![iNeptuno](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ineptuno/32/1036386_2.png) [@iNeptuno](https://forums.unrealengine.com/u/iNeptuno)\
**Post date:** [November 26, 2020, 4:58pm UTC](https://forums.unrealengine.com/t/player-can-spam-arrows-any-fix/475030/4 "2020-11-26T16:58:18Z")

</div>

I’ve tried to add this, because I saw it somewhere else, but I couldn’t do it because I work with both the “Pressed” and “Released” states from a Input Event. Do you know how can I make it work with that? Where should I set the timer? Thank you!

---

<div class="post-metadata">

**Author:** ![iNeptuno](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ineptuno/32/1036386_2.png) [@iNeptuno](https://forums.unrealengine.com/u/iNeptuno)\
**Post date:** [November 26, 2020, 4:59pm UTC](https://forums.unrealengine.com/t/player-can-spam-arrows-any-fix/475030/5 "2020-11-26T16:59:42Z")

</div>

Hi!  
I’ll check that, and what do you mean by “separating” the _Get Actor Of Class_?
