Basic

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 below.There are two ways to analogue Delay which practically do not differ from each other. Use the...

Georgy Treshchev Georgy Treshchev Jul, 2 2021

How to print strings to console or screen in Unreal Engine...

There are many reasons why this may be needed: for example, for debugging or testing code execution.We can define a custom log:If you decide to use a custom log, just replace "LogTemp" from the examples below with the name of your log ("LogNameExample" from the example above)Simple message: String message:Int message:Float message:FVector...

Georgy Treshchev Georgy Treshchev Apr, 1 2021

Ways to get GameInstance in Unreal Engine C++

There are several ways to get the GameInstance, and for the most part it depends on where you want to get this object from.In the examples below, "UGameInstanceCreated" is a C++ generated GameInstance class.If you have UWorld:If you don't have UWorld:If you are unsure of a specific method, there is an option for testing to understand that at least...

Georgy Treshchev Georgy Treshchev Feb, 17 2021

Creating a Circular Buffer in Unreal Engine C++

A ring buffer or circular buffer is a fixed-size queue that updates its old values with new ones in order from the last to the first element each iteration.This can be useful if there is an array of certain number of objects, which during the game should be replaced by new ones, shifting the entire array to the old elements, removing the oldest...

Georgy Treshchev Georgy Treshchev Feb, 9 2021