DeprojectScreenToWorld for SceneCapture2D

Hi,
Is there a similar function like UGameplayStatics::DeprojectScreenToWorld for SceneCapture2D ?

There is a TransformPosition node but last time I tried to use it using screenposition it caused a crash so I figured out how to do it using the custom node by seeing how its done internally.

float2 viewpos = (ScreenPos.xy - View.ScreenPositionScaleBias.wz) / View.ScreenPositionScaleBias.xy * 10;

float4 pos = mul( float4( viewpos, 10, 1 ) , View.ScreenToWorld );

return pos.xyz * (1 / pos.w);

Try the transform position node first and use this if it still crashes.

Also I haven’t used that code recently. If it fails to compile its probably because View got renamed to ResolvedView or something.

Thanks, But I am trying to do it inside a C++ code.
What I have is a pointer to an ASceneCapture2D and I would like to call a DeprojectFVector2D function something like this:

mySceneCapture2D->Deproject(in_2d_screen_position, out_3d_world_position);

I can see that SceneCapture2D has a CaptureComponent2D member who eventually has FSceneViewStateInterface reference but not FSceneView.
So how can it be done inside the C++ code?

Honestly I am not sure if its possible to do in c++ since I don’t know if the game code can have access to the scene depth or not. Passing this link to a rendering programmer.