Can't use ConsoleCommand() from PostBeginPlay() of GameInfo

On running my game for the first time, I’d like the initialize the resolution of the game to match the native res of the player’s display (i use ConsoleCommand(“setres 1920x1080”)).

I’ve tried added this call to the PostBeginPlay() of my GameInfo class, but it seems it have no effect here.

Because the implementation of ConsolCommand() is hidden in native code, I can’t investigate when is the first time I’m able to start using this function.

Obviously I can just defer this call with a timer (and then it works fine), but i ideally want to handle this the very instant the game starts.

Any ideas where/when I can start using ConsoleCommand() when the game starts?

use getalocalplayercontroller() and call it from there :slight_smile:

Out of curiosity, how do you access the native resolution of the display?

@Nathaniel3W Calling ConsoleCommand(“DUMPAVAILABLERESOLUTIONS”, false); will return a string of the available resolutions for the current display.

You have to parse it out using something like: ParseStringIntoArray(resolutionsString, resolutions, "
", true); and then do some logic to figure out the max.

There may be a better way, but this has been working for me.