How to get main camera view - c++?

I’m making a trading card game in where i want to resize the field to fit the camera view or at least part of it given some x and y percentages. It goes without saying, that the camera will be (at least as of now) a top down camera so i won’t need the z axis.

How would i in c++ get the main camera ( the camera attached to the current player) and get the size of the view (x and y components)?

Holy cow i misread you question:)-> deleted.

i was looking at the FMinimalViewInfo documentation but i couldn’t find a way to get the height and width of the camera view. sorry for my ignorance but can you tell me how to get what i want?

Well thank you for answering but as i’m pretty new to ue4 c++ i can’t get very much out of the docs. How would i get the current player, then get it’s camera and then get it’s view size?

Everything related to camera you can find in PlayerCameraMenager which is created for each player controller and also can be accessed from player controller

You can access PlayerController from any point (well where GEngine is active) using this:

if(GEngine) GEngine->GetFirstLocalPlayerController(())->PlayerCameraManager->...

But it’s good for single player, oher then that you need to follow other refrences that you can find in classes. The reast… will be your homework to learn how to use API reference :slight_smile: study it and learn swim in it, otherwise you will more ask quastions on small matters

oh, awesome!. thank you very much, i was looking for a way to get the PC but everything i found was with iterators and stuff i know i don’t needed, the ways i tried like getting the pc with the netid and some other stuff always made the game crash for violation errors.