I've got this script for the camera (not mine, just adjusted some values and trying to add stuff to it, but still not familiar with implementing code. - I want to get the camera FOV gradually from 70 to 100 when the car has a certain velocity/speed (follow_this.fwd_mps). Let's say the car is at 100 km/h (fwd_mps * 3.6), from that point on I want the FOV go up as velocity goes up. So when at max speed, it is at fov 100. I got it to work (kinda), with set_fov, but the fov gets too high and just jumps from one to the other. Do get_fov and set_fov still exist. It's described in the docs, but when typing in the script-editor, it doesn't show up in the list. The same way I also then want to do the same with target_distance (from 4 going to 3) and target_height (from 1 going to 0.5). Probably all 3 going to have the same method/function? Is it also something with that linear_interpolate()?

Still trying to figure out the panning the look_at when steering left or right. Still only been able to get it to work on h_offset, but didn't have the effect, car is still the focus then.

https://gist.github.com/eyeEmotion/3011cd6c6a8650487858e8cbabcc8e72

So currently got something like this to work. Don't know if it's a clean code, but this almost works (except that it changes over time and not over driving speed):

var minFOV = 70.0 var maxFOV = 100.0 var spdChangeFOV = 0.2

And at the bottom: if (follow_this.fwd_mps > 100): if (get_fov() < maxFOV): set_fov(get_fov() + follow_this.fwd_mps * delta * spdChangeFOV) else: if (get_fov() > minFOV): set_fov(get_fov() - follow_this.fwd_mps * delta * spdChangeFOV)

Still need to figure out how to change the target_distance and target_height gradually from one to the other.

Edit: also getting somewhere with: if (follow_this.fwd_mps > 100): if (get_fov() < maxFOV): set_fov( (follow_this.fwd_mps/follow_this.topspeed) * maxFOV ) . . .

3 years later