# Can i run function or change variable from console?

**URL:** <https://forums.unrealengine.com/t/can-i-run-function-or-change-variable-from-console/464928>\
**Category:** Editor Scripting\
**Tags:** variables, Variable, Console, unreal-engine, function, functions, question\
**Created:** [May 9, 2020, 4:14pm UTC](https://forums.unrealengine.com/t/can-i-run-function-or-change-variable-from-console/464928 "2020-05-09T16:14:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![1987kostya](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@1987kostya](https://forums.unrealengine.com/u/1987kostya)\
**Post date:** [May 9, 2020, 4:14pm UTC](https://forums.unrealengine.com/t/can-i-run-function-or-change-variable-from-console/464928/1 "2020-05-09T16:14:33Z")

</div>

Can I run a function in a specific object on the map using the console? Or maybe I can change the variable value using console

---

<div class="post-metadata">

**Author:** ![indivelope](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/indivelope/32/974286_2.png) [@indivelope](https://forums.unrealengine.com/u/indivelope)\
**Post date:** [September 10, 2021, 4:29am UTC](https://forums.unrealengine.com/t/can-i-run-function-or-change-variable-from-console/464928/2 "2021-09-10T04:29:17Z")

</div>

You can do reflection kinda. I am trying to figure out how to pass pointers instead of using text.  
But for pointers, using playerControllers UniqueID as a s string, then find the controller by the UID string passed in.

CallRemoteFunction is avaliable with void\*Args as an input, but I am yet to figure that out.

Hope this can help

```
void MyClass::BeginPlay()
{
	Super::BeginPlay();
	FString functionName = "MyTestFuntion";
	FString arg1 = "SomeCoolString";

	FOutputDeviceNull ar;
	const FString command = FString::Printf(TEXT("%s %i %s"), functionName, 34, *arg1);
	CallFunctionByNameWithArguments(*command, ar, this, true);

}

void MyClass::MyTestFuntion(int IntInput, const FString& StringInput)
{
	UE_LOG(LogTemp, Warning, TEXT("%i %s"),IntInput, *StringInput);
}

```

EDIT:: TFunctions are what we are both looking for I think.

> **[TFunction](https://docs.unrealengine.com/4.27/en-US/API/Runtime/Core/GenericPlatform/TFunction/)**
>
> TFunction

Or this lol

[https://nerivec.github.io/old-ue4-wiki/pages/function-pointers.html](https://nerivec.github.io/old-ue4-wiki/pages/function-pointers.html)

---

<div class="post-metadata">

**Author:** ![Tomasz\_Klin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tomasz\_Klin](https://forums.unrealengine.com/u/Tomasz_Klin)\
**Post date:** [September 28, 2026, 8:38pm UTC](https://forums.unrealengine.com/t/can-i-run-function-or-change-variable-from-console/464928/3 "2026-09-28T20:38:45Z")

</div>

Yes, and you don’t need C++ for it. `ke * MyFunction 10` calls a function or custom event on everything in the world that has it, and `set BP_Door_C bLocked false` changes a variable on every instance of that class. You have to know the exact names though, and ke doesn’t show what the function returned.

I made a plugin that makes this easier (full disclosure, it’s mine): [Actor Console | Fab](https://www.fab.com/listings/f34dbf3f-94b8-426d-a8aa-8901f678cb46) , UE 5.6+. There it’s `@Door.bLocked false` or `@Door.Open()` using the name from the Outliner, with autocomplete, and it prints the result.
