[INI] - UE4 not Writing Values

Hi,
I Know i am asking a lot of questions recently but thats just because i just got into ue4 related c++ just a couple days ago.

what i want to know is why ue4 isnt writing my values.
here is the code:
CPP

#include "MyPlayerController.h"
#include "Runtime/Core/Public/Misc/ConfigCacheIni.h"

FString Section = "Evo.user";

void AMyPlayerController::SetConfig() {
	/* Format 
	(
		*Section,
		Key,
		Value,
		FileName
	);
	*/

	// Writing To The Config File
	if (!GConfig) return;

	GConfig->SetBool(
		*Section,
		TEXT("b_isTrue"),
		TEXT("true"),
		GGameIni
	);
	GConfig->Flush(false, GGameIni);
}
void AMyPlayerController::GetConfig() {
	/*
	Format 
	(
	Section,
	Key,
	Value,
	FileName
	);
	*/

	if (!GConfig) return;

	// Getting the Value
	GConfig->GetBool(
		*Section,
		TEXT("b_isTrue"),
		b_isTrue,
		GGameIni
		);
}

.H

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "MyPlayerController.generated.h"

/**
 * 
 */
UCLASS()
class EVO_API AMyPlayerController : public APlayerController
{
	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere)
		bool b_isTrue;

	void GetConfig();
	void SetConfig();
};

i Know im doing something wrong probably. By the way i followed Rama’s Wiki for this.

can anyone help me out. also if i want to write into a file of my own (in saved/config/windows). how will i do that? like do i have a create a file with whatever name i want [a ini one]. for ex: User and in the code use it like so:
GUserIni?

i will check to see if this works

by the way will this add the value in the ini file itself? and the " input " is the actual file name?

This is how I’ve made mine work.

// Header file
UCLASS(Blueprintable, Config=Input)
class PROJECT_API UMyConfig : public UObject
{
	GENERATED_BODY()

public:
	UFUNCTION(BlueprintCallable)
	void SaveConfig();
	
public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Settings", Config)
	int MyConfigVar;
};

// cpp file
void UMyConfig::SaveConfig()
{
    Super::SaveConfig();
}

yes, this will add variable to input.ini

Actually I don’t remember if it was a filename or a predefined constant, you may check, and if not,we will find out how to specify the file name.

Nop doesnt work

Well i have tried this isnt working for some reason :confused:

Sorry, I don’t remember everything (I’ve done it 2 months ago, took 3-4 days to figure out) and I can’t look through it right now. I’ll do it as soon as I get some free time, and report you back. Meanwhile someone may answer.

One more thing. In my example I’ve used an UObject derived class, which was referenced in UCustomGameUserSettings. In your example you are using an AActor derived class. I wonder if you have created an instance of that actor in your level?

No, i did had the actor added in the scene and even tried creating a UObject class and doing it in there, still doesnt work

I Got it working. just used the code in the blueprint function library.