# How would i implement weapon Firerate

**URL:** <https://forum.playcanvas.com/t/how-would-i-implement-weapon-firerate/28223>\
**Category:** Help & Support\
**Created:** [November 3, 2022, 8:12pm UTC](https://forum.playcanvas.com/t/how-would-i-implement-weapon-firerate/28223 "2022-11-03T20:12:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Leonidas](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/leonidas/32/6495_2.png) [@Leonidas](https://forum.playcanvas.com/u/Leonidas)\
**Post date:** [November 7, 2022, 9:54am UTC](https://forum.playcanvas.com/t/how-would-i-implement-weapon-firerate/28223/2 "2022-11-07T09:54:21Z")

</div>

Hi @Thebosser_24,

I don’t have an example in mind, but for fire rate you usually implement a cooldown timer. After each bullet fired you start a timer e.g. for 0.1 sec and in that period you don’t allow any more bullets to fire.

Do a forum search on how to add a timer in a PlayCanvas script.

For recoil you will need to move/animate your weapon between two threshold values. You can use PlayCanvas tween or lerping. It can be a bit advanced but do search on how to animate entities in the forum to get some good examples and get started.

Hope that helps.

---

_[View the full topic](https://forum.playcanvas.com/t/how-would-i-implement-weapon-firerate/28223)._
