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 methods below.There are two ways to analogue Delay, which can be implemented inside one method (without...

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

How to properly comment methods in Unreal Engine

Code commenting is a very important programming task not only for the customer, but also for the developer himself. It often happens that after a few months, when a developer turns to his code, he cannot understand the meaning of certain methods that he himself once wrote, and it becomes very difficult to delve into this code. In order not to...

Georgy Treshchev Georgy Treshchev Feb, 19 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...

Georgy Treshchev Georgy Treshchev Feb, 17 2021