# SetCVar not working when ALLOW\_OTHER\_PLATFORM\_CONFIG is false 

**URL:** <https://forums.unrealengine.com/t/setcvar-not-working-when-allow-other-platform-config-is-false/2678242>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [October 16, 2025, 11:41am UTC](https://forums.unrealengine.com/t/setcvar-not-working-when-allow-other-platform-config-is-false/2678242 "2025-10-16T11:41:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 16, 2025, 11:41am UTC](https://forums.unrealengine.com/t/setcvar-not-working-when-allow-other-platform-config-is-false/2678242/1 "2025-10-16T11:41:48Z")

</div>

Hello Epic,

We found that the SetCVar console command is not working as expected when ALLOW\_OTHER\_PLATFORM\_CONFIG is false. When this preprocessor define is true, we can use SetCVar to set a cvar to a specific value and a specific priority, but when ALLOW\_OTHER\_PLATFORM\_CONFIG is false, SetCVar reports “Unable to lookup a CVar value on another platform in this build”. We believe this is a bug in the SetUnsetCVar function in ConsoleManager.cpp, and the end of this function should be as follows:

```auto
	if (CVar == nullptr)
	{
 Ar.Logf(TEXT("No CVar named %s"), *CVarName);
 return;
	}
 
	// get platform version
	if (PlatformName.Len())
	{
 
#if ALLOW_OTHER_PLATFORM_CONFIG
 CVar = CVar->GetPlatformValueVariable(*PlatformName, *DeviceProfileName).Get();
 
 if (CVar == nullptr)
 {
 Ar.Logf(TEXT("Failed to get CVar for platform %s"), *PlatformName);
 return;
 }
#else
 Ar.Logf(TEXT("Unable to lookup a CVar value on another platform in this build"));
 return;
#endif
	}
 
 
	FString Value;
	if (bSet)
	{
 Value = FParse::Token(Params, false);
	}
 
	EConsoleVariableFlags SetBy = ECVF_SetByConsole;
	FName Tag = NAME_None;
	FString Str;
 
	if (FParse::Value(Params, TEXT("-setby="), Str))
	{
 SetBy = GetConsoleVariableSetByValue(*Str);
	}
 
	if (FParse::Value(Params, TEXT("-tag="), Str))
	{
 Tag = *Str;
	}
 
	if (bSet)
	{
 CVar->Set(*Value, SetBy, Tag);
	}
	else
	{
 CVar->Unset(SetBy, Tag);
	}
}

```

We basically just move the #if line and the #else block of code.

Can you please confirm that this is the expected behavior?

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 16, 2025, 11:41am UTC](https://forums.unrealengine.com/t/setcvar-not-working-when-allow-other-platform-config-is-false/2678242/2 "2025-10-16T11:41:53Z")

</div>

**Steps to Reproduce**  
Compile the engine with ALLOW\_OTHER\_PLATFORM\_CONFIG set to false and use the SetCVar console command to set any CVar to a given value. Instead of setting the CVar to the given value, the engine reports “Unable to lookup a CVar value on another platform in this build”.

---

<div class="post-metadata">

**Author:** ![Paul](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Paul](https://forums.unrealengine.com/u/Paul)\
**Post date:** [October 22, 2025, 2:12pm UTC](https://forums.unrealengine.com/t/setcvar-not-working-when-allow-other-platform-config-is-false/2678242/3 "2025-10-22T14:12:06Z")

</div>

Hi,

I believe that your fix is correct, we should only be preventing access to the cvar values for other platforms if ALLOW\_OTHER\_PLATFORM\_CONFIG is 0, not the current platforms.

Would you like me to just submit this to UE 5.8 or would you prefer to make a GitHub PR so that we can properly credit you with the fix? Unfortunately due to various data rules we require the PR to be able to correctly credit people.

---

<div class="post-metadata">

**Author:** ![Paul](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Paul](https://forums.unrealengine.com/u/Paul)\
**Post date:** [October 23, 2025, 1:42pm UTC](https://forums.unrealengine.com/t/setcvar-not-working-when-allow-other-platform-config-is-false/2678242/4 "2025-10-23T13:42:58Z")

</div>

Thanks, I’ll grab that once it makes it’s way through our system but given my timezone (GMT+2) I will not be able to safely submit this until tomorrow. I will reply here again to confirm once it is in.

---

<div class="post-metadata">

**Author:** ![Paul](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Paul](https://forums.unrealengine.com/u/Paul)\
**Post date:** [October 24, 2025, 1:55pm UTC](https://forums.unrealengine.com/t/setcvar-not-working-when-allow-other-platform-config-is-false/2678242/5 "2025-10-24T13:55:06Z")

</div>

UE5 Main CL 47305175

GitHub Hash 35a68ee662166beac18ec24214f3315544cf18c4

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 23, 2025, 9:33am UTC](https://forums.unrealengine.com/t/setcvar-not-working-when-allow-other-platform-config-is-false/2678242/6 "2025-10-23T09:33:29Z")

</div>

I’ll prepare a PR.

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 23, 2025, 1:39pm UTC](https://forums.unrealengine.com/t/setcvar-not-working-when-allow-other-platform-config-is-false/2678242/7 "2025-10-23T13:39:02Z")

</div>

[https://github.com/EpicGames/UnrealEngine/pull/13961](https://github.com/EpicGames/UnrealEngine/pull/13961)
