Config Variable in blueprint, how to set it up correctly?

I am having a lot of trouble trying to figure out how to set a variable from DefaultGame.ini from a blueprint. There doesnt seem to be any useful documentation about it, only C++.

What I have so far looks like this in DefaultGame.ini

[/Game/testActor.testActor]
test2="hi"
test=5

I have Config Variable checked for both variables. However they just wouldnt load the correct values. I suspect I have something wrong in the section name. I am not sure how to set it. Where to get the correct package name, and is the class name correct in this case?

Any help will be greatly appreciated.

1 Like

If you mouseover the Config variable checkbox in your class’ variable settings in the editor, the tooltip should tell you the path you need to enter as class identifier.

At the very least, you’ll need to add a “_C” to the string, i.e. “testActor.testActor_C”. I also think you might have to edit DefaultEngine.ini, but that’s something the tooltip will also tell you.

1 Like

Thank you for the help. However the tooltip I get doesnt have any of those information. Am I missing something? Screenshot attached.

That’s strange. I have UE on two computers (4.8.2 at home and 4.8.3 at work) and both show the detailed tooltips. I’m fairly sure I haven’t added any plugins.

53892-config_tooltip.png

Basically, you need to do the following:

  1. add your config variable to the DefaultEngine.ini
  2. add a section containing the relative project path to your class, starting with /Game as the Content folder

In my case, the class is called CombatComponent and is placed in Content/LevelProtoype/BluePrints folder.

Assuming you’ve created your Blueprint in StarterContent/Blueprints, the section would be

[/Game/StarterContent/Blueprints/TestAsset.TestAsset_C]

I hope this helps.

1 Like

Thanks a lot. I will try it out and let you know. But it looks about right! No idea why the tooltip is different that yours.

All worked out perfect. Thanks a lot for the help really. You saved me from insanity.

I also did this, but engine never correctly loads and assigns the value. Can you show the config file ?
thanks

I solved this. Thanks

Hey guies, I am stuck I’ve added Section shown in ToolTip of the config and after that key=value pair too. but its not working.

Following is ToolTip snap

and following is DefaultEngine.ini
[/Game/FirstPersonBP/Blueprints/Actor.Actor_c]
ConfigVar=10

76460-tooltip.png

Please help me out.

Can you please tell me how did you solve?

I think that if the parent class is Actor is possible.
However, if it is inherited from the PlayerController, it is impossible to achieve.
Good luck !.

hi 二十七杯酒
thanks for your answer.I found you are right
but if I only want some variable in PlayerController or Gamemode can be config.how can I achive this function?