How would i implement weapon Firerate

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.

3 Likes