Should RHIGetAvailableResolutions work?

So I’m trying to make a resolution option, and the obvious looking function to use is RHIGetAvailableResolutions.
Here’s how I called it:

FScreenResolutionArray resArray = FScreenResolutionArray();
	RHIGetAvailableResolutions(resArray, true);
	resolutionArray = resArray;
	FScreenResolutionArray::TIterator resItr = resArray.CreateIterator();

	while (resItr)
		FScreenResolutionRHI cRes = *resItr;

		FString resString = FString::FromInt(cRes.Width) + FString("x") + FString::FromInt(cRes.Height);
		TSharedPtr<FString> tempShared = MakeShareable<FString>(new FString(resString));



Unfortunately it doesn’t seem to work (resArray is empty), am I doing something wrong? Do I need to call it from somewhere specific?

The way I use it is this

bool UUserSettingsFuncLib::GetSupportedScreenResolutions(TArray<FString>& Resolutions)
	FScreenResolutionArray ResolutionsArray;

	if (RHIGetAvailableResolutions(ResolutionsArray,true))
		for (const FScreenResolutionRHI& Resolution : ResolutionsArray)
			FString StringH = FString::FromInt(Resolution.Height);
			FString StringW = FString::FromInt(Resolution.Width);
			Resolutions.AddUnique(StringW + "x" + StringH);
		return true;
	else return false;

and I pass the Resolutions array to Blueprints and I set my Resolution Combo Box Options with this array

Also make sure that you have “RHI” inside you .Build.cs dependency module names list