How to use delays in C++ in Unreal Engine

Some developers are wondering about the C++ equivalent of the Delay node in Blueprints. In C++, it is not recommended to make delays for cosmetic things. But if there are something that require high optimization, then consider the following ways. There are two ways to implement Delay that are very similar. Use the option that is more readable and convenient for you. Lambas Using FTimerDelegate FTimerDelegate TimerDelegate; TimerDelegate.BindLambda([&] { UE_LOG(LogTemp, Warning, TEXT("This text will appear in the console 3 seconds after execution")) }); FTimerHandle TimerHandle; GetWorld()->GetTimerManager()....

July 3, 2022 · 1 min · Georgy Treshchev

How to completely disable Tonemapper in Unreal Engine

In this quick tutorial, I will show you how to completely disable Tonemapper without using PostProcess To do this, just open the DefaultEngine.ini file (in the [PROJECT_NAME]/Config folder) and add the following lines to [/Script/Engine.RendererSettings] section: r.TonemapperGamma = 0 r.TonemapperFilm = 0 r.Tonemapper.Quality = 0 r.ToneCurveAmount = 0 r.Mobile.TonemapperFilm = 0 r.MobileTonemapperUpscale = 0 r.EyeAdaptationQuality = 0 r.EyeAdaptation.ExponentialTransitionDistance = 0 You can also write the same to the engine’s command line, but I recommend to directly add these lines to a separate file since it’s more convenient....

June 26, 2022 · 1 min · Georgy Treshchev
Containers time complexity

Intro to Unreal Engine containers

This article may be helpful for those who are familiar with standard containers and would like to learn Unreal-specific containers, or for those who already know containers but would like to explore them a little deeper. Here is information about the following containers: TArray, TSet, TMap. TArray Let’s start with TArray. TArray is a dynamically sized array, which is similar to vector in the standard library. The main purpose of TArray is to be able to easily (both memory and performance) iterate over its elements....

June 5, 2022 · 4 min · Georgy Treshchev

How to convert Enum to FString in Unreal Engine

Implementation depends on what enum you use. If you want to use an Unreal Reflection System-friendly solution that uses UENUM, there is a ready-made function for this: // Header file // This is your enum UENUM() enum class EnumExample : uint8 { EnumValue1, EnumValue2 }; // Implementation file // This is how you get the string representation of the enumerator FString StringRepresentation = UEnum::GetValueAsString(EnumExample::EnumValue2); If you want to use a pure C++ solution, you should create a function to manually convert the enumerator....

May 29, 2022 · 1 min · Georgy Treshchev