I am making an 3D fps game, I have a player when it shoots the recoil moves the camera up, but it seems unnatural, I want it to be smooth and less rigid,I thought of trying to use lerp but im not sure on how to do this with camera movement I also thought of using linear interpolate but thats beyond me, as I dont exactly know what it does or how to use it!
Line of code where recoil happens:
if Input.isactionpressed("fire") and currentammo != 0 and currenthealth != 0 and canfire == true:
vertical.rotationdegrees.x += recoil
Also, Please suggest ways on improving this recoil, at the moment it only goes up so if you guys could suggest a way to make it similar to call of duty, or just improve it in general, I would appreciate it, thanks!