unreal-engine4unreal-engine5unreal-blueprintunrealscriptunreal

I cannot find the focal length of the camera in unreal engine


When playing the game in unreal, there is a camera that follows the character. I have gone to the view port clicked on the camera and checked the details, nowhere is it mentioned about the focal length. how to get the focal length. There's a function called get current focal length but i dont know what the target input is supposed to be. Is there ay way to get the focal length of the camera.

The blueprint i am trying


Solution

  • This is because the node you are attempting to use is for the cinematic camera, which tries to simulate a real camera and has many more options to mimic a real camera.

    Surprisingly there is no easy way to get the focal length of the regular camera but thankfully we have access to the project matrix. We know that in the projection matrix m11 is the focal length (x in the following screenshot) [1]. A little convoluted but it gets the job done.

    enter image description here

    [1] see this answer for explanation: https://stackoverflow.com/a/46079014/368599