I'm making a FPS game in Ursina, and I'd like to be able to aim. I will do this, I think, by changing the camera's FOV : it is perfect !
The problem is that I'd like to be able to animate the transition of aiming. I cannot use a for loop, as the FOV only updates once it is finished, and I cannot use the animate method... I tried :
camera.animate("fov", -30, duration = 2, delay=0, auto_destroy = True)
With the syntax :
animate(name, value, duration=.1, delay=0, curve=curve.in_expo, loop=False, resolution=None, interrupt='kill', time_step=None, auto_destroy=True)
Here, my value (I'd like to decrease my FOV, so to zoom, by 30) doesn't mean anything : I can put whatever I want, and it will not stop until the fov is equal to 0.
Is there a way to fix that ? Either by finding a method to update the camera in the for loop, or either by finding any way to animate the FOV transition
Found the answer : the value parameter is actually not the value you want to increase or decrease your FOV (or anything) of, but it's actually the value it will go to ! So, if I put 1, my FOV will go to 1, that's why. To animate -30 for my FOV, the correct syntax is :
camera.animate("fov", camera.fov-30, duration = 2, delay=0, auto_destroy = True)