IConsoleVariable::SetOnChangedCallback

Allows to specify a callback function that is called when the console variable value changes.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/HAL/IConsoleManager.h

Include

#include "HAL/IConsoleManager.h"

Syntax

void SetOnChangedCallback
(
    const FConsoleVariableDelegate & Callback
)

Remarks

Allows to specify a callback function that is called when the console variable value changes. Is even called if the value is the same as the value before. Will always be on the game thread. This can be dangerous (instead try to use RegisterConsoleVariableSink())

  • Setting other console variables in the delegate can cause infinite loops

  • Setting many console variables could result in wasteful cycles (e.g. if multiple console variables require to reattach all objects it would happen for each one)

  • The call can be at any time during initialization. As this cannot be specified during constructions you are not called on creation. We also don't call for the SetOnChangedCallback() call as this is up to the caller.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss