Here's a video of my problem (notice how the firing rate sometimes changes slightly between shots, at random):
On higher fire rates this becomes very noticeable and feels really bad.
(I tried modifying the fire rate to higher and lower values, but the problem still persisted.)
Here is the relevant code:
func _input(event: InputEvent) -> void:
func shoot(gun: Object) -> void:
#shoot bullets and play sound effect
The problem isn't with the shoot() function, because when I removed almost all of its code, nothing changed
func next_shot(gun: Object) -> void:
gun.can_shoot = true
if gun.is_automatic and Input.is_action_pressed("left_click"):
I don't know if the problem is with my code or something else, but I'm really stumped on this issue at the moment.