Hi,
Camera settings only provide a way to change the horizontal fov :
Same in Blueprint :
How can we force vertical FOV ?
Thanks
Hi,
Camera settings only provide a way to change the horizontal fov :
Same in Blueprint :
How can we force vertical FOV ?
Thanks
Use this to lock it to vertical (the wider the monitor the more you see to the sides (like it should be)).
-Remember to use degrees not radians.
-Put it to the Tick function to make sure it updates if the viewport is changed.
Thank you ! Just great
Works like a charm. GG
Just keep in mind that “Make Literal float” is a VERTICAL VALUE - for FOV 90, this value will be 59. The calculator is at Horizontal/Vertical FOV Calculator
C++ Version:
int x, y;
World->GetFirstPlayerController()->GetViewportSize(x, y);
Camera->FieldOfView = FMath::RadiansToDegrees(2 * FMath::Atan(FMath::Tan(FMath::DegreesToRadians(Camera->FieldOfView) / 2) * x / y));
Can I get a version of this, but to lock the horizontal FOV? Thanks!
Horizontal field of view works in the engine by default/
I don’t think calculating and setting FOV in every tick is a good way.
You should try following INI setting.
[/Script/Engine.LocalPlayer]
AspectRatioAxisConstraint=AspectRatio_MaintainYFOV
Or you can Call GetLocalPlayer()->AspectRatioAxisConstraint = EAspectRatioAxisConstraint::AspectRatio_MaintainYFOV;