Help with how to implement turret recoil

Godot Version

Godot 4.2.1

Question

I have a CharacterBody2D node which has a two sprites as it’s children (main turret body and the muzzle). I made them separate nodes as I wanted to make interchangeable muzzles later. It also has a timer called “Bullet Timer”, this is for the turret to stop shooting for a second after shooting to prevent spamming.
I would like to add a randomized recoil to the turret whenever it releases a projectile, but I am not sure as to how to approach this problem. Any help? I considered using the tween but that node doesn’t exist anymore. Is there perhaps a method in script I can use to do this?

why not use an AnimationPlayer you can make a 2 frame animation of the muzzle moving back and forth you can play the animation when you shoot

Ok, thank you yet again

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.