I’ve looked around but havent found an answer to this specifically
What I want is to smoothly zoom in the camera while the player is crouching to reduce their visibility
I know how to detect when the button is pressed and when its released, and i know how to change the zoom variable in my script, but what i cant figure out is how i would go about smoothly incrementing the zoom while the button is pressed, and then smoothly zoom back out when its released. Thanks for the help
You could use an AnimationPlayer node or create_tween to animate the zoom change. Use the Input system such as overriding _unhandled_input to get when buttons are pressed and/or released.
do you think it would work if i made an animation with the minimum and maximum zoom values as keyframes, and then inside the match state told it to play the animation when true, and play it in reverse when false?
edit: yes it does!
extends Camera2D @onready var animation_player: AnimationPlayer = $AnimationPlayer