{"id":13589701,"url":"https://github.com/MrRobinOfficial/Guide-UnrealEngine","last_synced_at":"2025-04-08T09:34:01.501Z","repository":{"id":189822374,"uuid":"630492529","full_name":"MrRobinOfficial/Guide-UnrealEngine","owner":"MrRobinOfficial","description":"This repository is designed to help developers learn how to get started with Unreal Engine and C++.","archived":false,"fork":false,"pushed_at":"2024-07-31T11:17:51.000Z","size":8263,"stargazers_count":729,"open_issues_count":0,"forks_count":59,"subscribers_count":17,"default_branch":"main","last_synced_at":"2024-08-02T02:28:40.840Z","etag":null,"topics":["cpp","docs","documentation","examples","guide","learn","unreal-engine"],"latest_commit_sha":null,"homepage":"","language":"Markdown","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrRobinOfficial.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-20T13:53:15.000Z","updated_at":"2024-08-01T03:04:54.000Z","dependencies_parsed_at":"2023-08-21T23:25:33.038Z","dependency_job_id":"3a412b14-1860-47d5-8a04-5c8ce6081416","html_url":"https://github.com/MrRobinOfficial/Guide-UnrealEngine","commit_stats":null,"previous_names":["mrrobinofficial/guide-unrealengine"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobinOfficial%2FGuide-UnrealEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobinOfficial%2FGuide-UnrealEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobinOfficial%2FGuide-UnrealEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobinOfficial%2FGuide-UnrealEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrRobinOfficial","download_url":"https://codeload.github.com/MrRobinOfficial/Guide-UnrealEngine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223314305,"owners_count":17125051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","docs","documentation","examples","guide","learn","unreal-engine"],"created_at":"2024-08-01T16:00:33.252Z","updated_at":"2024-11-06T09:31:25.354Z","avatar_url":"https://github.com/MrRobinOfficial.png","language":"Markdown","readme":"![Banner](static/img/Banner.png)\n\n\u003cdiv align=\"center\"\u003e\n\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/mrrobinofficial/guide-unitysteamnetcodegameobjects/blob/HEAD/LICENSE.txt)\n![GitHub Repo stars](https://img.shields.io/github/stars/MrRobinOfficial/Guide-UnrealEngine)\n![guide-status](https://img.shields.io/badge/guide_status-revision-91ff00)\n\n![permitted-status](https://img.shields.io/badge/permitted_status-allow_to_use_for_tutorials_and_articles-4A5173)\n![reading-time](https://img.shields.io/badge/reading_time-3,98_hours-blue)\n![word-count](https://img.shields.io/badge/word_count-36,438-blue)\n\n![GitHub issues](https://img.shields.io/github/issues/MrRobinOfficial/Guide-UnrealEngine)\n![GitHub closed issues](https://img.shields.io/github/issues-closed/MrRobinOfficial/Guide-UnrealEngine)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/MrRobinOfficial/Guide-UnrealEngine)\n![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/MrRobinOfficial/Guide-UnrealEngine)\n\n\u003c/div\u003e\n\n#\n\n**Are you interested in creating games with Unreal Engine using C++?**\n\n_In this repo, we'll guide you through the basics of getting started with Unreal Engine and C++. We'll cover the fundamentals of C++ programming, such as data types and pointers, and show you how to use these concepts in the context of game development with Unreal Engine. We'll also introduce you to the Unreal Engine module system, which is an important aspect of organizing your game code into smaller, more manageable pieces._\n\n\u003e [!IMPORTANT]\n\u003e If you want to use another language for Unreal Engine, like C#, then highly recommend checking out this [repo by Oscar Olsson](https://github.com/UnrealSharp/UnrealSharp).\n\n\u003e [!NOTE]\n\u003e This repository was created in conjunction with [ChatGPT](https://en.wikipedia.org/wiki/ChatGPT) to assist in writing and formulating each sentence. While it provides valuable information, it may not be entirely accurate. If you detect any errors or false statements, please feel free to create a new [issue](https://github.com/MrRobinOfficial/Guide-UnrealEngine/issues/) to report them for further improvement and clarification.\n\u003e\n\u003e You can also send a new [pull request](https://github.com/MrRobinOfficial/Guide-UnrealEngine/pulls) to make correct changes to codebase.\n\u003e\n\u003e **Your contributions and feedback are appreciated!**\n\n\u003e [!NOTE]\n\u003e Examples and documentation are intended to work on **UE 5.0** version and upwards. Some code may or may not work on previous versions!\n\n\u003e [!IMPORTANT]\n\u003e If you want to see the newest changes, you can check out the [dev branch](https://github.com/MrRobinOfficial/Guide-UnrealEngine/tree/dev). However, be aware of experimental changes and work in progress text.\n\n## Table of contents\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [👑 Cheatsheets](#-cheatsheets)\n- [🎩 Plugins](#-plugins)\n  - [Marketplace Plugins](#marketplace-plugins)\n  - [Github Plugins](#github-plugins)\n  - [Epic Games Plugins](#epic-games-plugins)\n  - [MrRobinOfficial's Plugins](#mrrobinofficials-plugins)\n- [📛 Console Commands](#-console-commands)\n- [📌 Shortcuts](#-shortcuts)\n- [⌛ Getting started with C++](#-getting-started-with-c)\n  - [🌈 Integrated Development Environment](#-integrated-development-environment)\n  - [⛏️ Tools to help your journey](#-tools-to-help-your-journey)\n  - [🟢 Benefits of using C++ with Unreal Engine](#-benefits-of-using-c-with-unreal-engine)\n  - [🔴 Drawbacks of using C++ with Unreal Engine](#-drawbacks-of-using-c-with-unreal-engine)\n- [🌍 Summary of C++ and Programming World](#-summary-of-c-and-programming-world)\n- [🚧 Blueprint vs C++](#-blueprint-vs-c)\n- [🎪 Architecture](#-architecture)\n- [⚓ Guidelines](#-guidelines)\n  - [🎳 Naming Convention](#-naming-convention)\n    - [🎨 Abbreviations, Acronyms and Synonyms](#-abbreviations-acronyms-and-synonyms)\n    - [Prefixes](#prefixes)\n  - [Coding standard](#coding-standard)\n- [💎 Unreal Header Tool](#-unreal-header-tool)\n  - [UPROPERTY](#uproperty)\n    - [Specifiers](#specifiers)\n    - [Meta tags](#meta-tags)\n    - [Examples](#examples)\n  - [UFUNCTION](#ufunction)\n    - [Common Specifiers](#common-specifiers)\n    - [Common Meta tags](#common-meta-tags)\n    - [Examples](#examples-1)\n  - [UCLASS](#uclass)\n    - [Common Specifiers](#common-specifiers-1)\n    - [Common Meta tags](#common-meta-tags-1)\n    - [Examples](#examples-2)\n  - [USTRUCT](#ustruct)\n    - [Common Specifiers](#common-specifiers-2)\n    - [Common Meta tags](#common-meta-tags-2)\n    - [Examples](#examples-3)\n  - [UENUM](#uenum)\n    - [Common Specifiers](#common-specifiers-3)\n    - [Common Meta tags](#common-meta-tags-3)\n    - [Examples](#examples-4)\n  - [UPARAM](#uparam)\n    - [Examples](#examples-5)\n  - [UMETA](#umeta)\n    - [Common Specifiers](#common-specifiers-4)\n    - [Examples](#examples-6)\n- [🧱 Data Types](#-data-types)\n  - [Characters](#characters)\n  - [Booleans](#booleans)\n  - [Integers](#integers)\n  - [Floating point numbers](#floating-point-numbers)\n  - [🛟 Size can vary](#-size-can-vary)\n  - [🦺 Unreal Engine Typedefs](#-unreal-engine-typedefs)\n  - [📖 String Data Types](#-string-data-types)\n  - [Text Macros](#text-macros)\n    - [FName](#fname)\n    - [FText](#ftext)\n    - [FString](#fstring)\n  - [🚀 Math Data Types](#-math-data-types)\n    - [Vector4](#vector4)\n    - [Vector3](#vector3)\n    - [Vector2](#vector2)\n    - [IntPoint](#intpoint)\n    - [IntRect](#intrect)\n    - [Rotator](#rotator)\n    - [Quaternion](#quaternion)\n    - [Transform](#transform)\n    - [Plane](#plane)\n    - [Matrix](#matrix)\n    - [Sphere](#sphere)\n    - [Box](#box)\n    - [Box2D](#box2d)\n    - [Ray](#ray)\n    - [Colors](#colors)\n  - [💐 Collections](#-collections)\n    - [TArray](#tarray)\n    - [TSet](#tset)\n    - [TMap](#tmap)\n    - [Common and helpful functions](#common-and-helpful-functions)\n    - [Algo Namespace](#algo-namespace)\n    - [TMultiMap](#tmultimap)\n    - [TStaticArray](#tstaticarray)\n    - [FHashTable](#fhashtable)\n    - [TStaticHashTable](#tstatichashtable)\n    - [TSortedMap](#tsortedmap)\n    - [TList](#tlist)\n    - [TLinkedList](#tlinkedlist)\n    - [TDoubleLinkedList](#tdoublelinkedlist)\n    - [TQueue](#tqueue)\n    - [TArrayView](#tarrayview)\n    - [String View](#string-view)\n    - [String Builder](#string-builder)\n    - [TEnumAsByte](#tenumasbyte)\n  - [🧨 Value type vs Reference type](#-value-type-vs-reference-type)\n  - [👈 Pointers](#-pointers)\n    - [🦴 Raw pointers](#-raw-pointers)\n    - [🤖 Smart pointers library](#-smart-pointers-library)\n      - [TSharedPtr](#tsharedptr)\n      - [TWeakPtr](#tweakptr)\n      - [TUniquePtr](#tuniqueptr)\n    - [🤖 Smart `UObject` pointers](#-smart-uobject-pointers)\n      - [TWeakObjectPtr](#tweakobjectptr)\n      - [TWeakInterfacePtr](#tweakinterfaceptr)\n      - [TSoftObjectPtr](#tsoftobjectptr)\n      - [TSoftClassPtr](#tsoftclassptr)\n  - [🔖 Keywords](#-keywords)\n    - [Constants](#constants)\n    - [Access modifiers](#access-modifiers)\n    - [Class, struct and memory](#class-struct-and-memory)\n    - [Function related](#function-related)\n    - [Casts](#casts)\n    - [Flow controls](#flow-controls)\n    - [Generic programming](#generic-programming)\n    - [Misc](#misc)\n- [👷 Constructors, destructors and initialization](#-constructors-destructors-and-initialization)\n    - [Constructors](#constructors)\n    - [Destructors](#destructors)\n    - [Constructors and destructors in UE](#constructors-and-destructors-in-ue)\n    - [Initialization](#initialization)\n- [🏛 Create custom class](#-create-custom-class)\n  - [AActor](#aactor)\n  - [UActorComponent](#uactorcomponent)\n  - [USceneComponent](#uscenecomponent)\n  - [APawn](#apawn)\n  - [UObject](#uobject)\n- [🏛 Create custom interface](#-create-custom-interface)\n  - [Creating interface inside C++](#creating-interface-inside-c)\n  - [Extending the interface function:](#extending-the-interface-function)\n  - [Calling the interface function](#calling-the-interface-function)\n  - [Checking if the UObject extends the interface](#checking-if-the-uobject-extends-the-interface)\n  - [Reference to an interface object](#reference-to-an-interface-object)\n- [🛸 Reflection System](#-reflection-system)\n- [🗑️ Garbage Collection](#-garbage-collection)\n  - [How does it work](#how-does-it-work)\n    - [Rules](#rules)\n    - [Examples](#examples-7)\n  - [Manual memory management](#manual-memory-management)\n  - [Collection and Mark as garbage](#collection-and-mark-as-garbage)\n  - [Validation](#validation)\n- [💾 Soft vs hard references](#-soft-vs-hard-references)\n  - [Soft References](#soft-references)\n  - [Hard References](#hard-references)\n- [🌍 Global Functions](#-global-functions)\n- [🏛️ Libraries](#-libraries)\n  - [Kismet Library](#kismet-library)\n  - [Misc Library](#misc-library)\n- [📃 Macros](#-macros)\n- [📜 Logging](#-logging)\n  - [UE_LOGFMT](#ue_logfmt)\n  - [Log to game-view](#log-to-game-view)\n- [🪨 Assertions](#-assertions)\n  - [Check](#check)\n  - [Verify](#verify)\n  - [Ensure](#ensure)\n  - [Alternatives Assertions](#alternatives-assertions)\n  - [Misc Assertions](#misc-assertions)\n- [🔔 Delegates](#-delegates)\n  - [Define a delegate type](#define-a-delegate-type)\n  - [Declare a delegate variable](#declare-a-delegate-variable)\n  - [Bind functions to the delegate](#bind-functions-to-the-delegate)\n  - [Trigger the delegate](#trigger-the-delegate)\n  - [Summary](#summary)\n- [🧩 UMG](#-umg)\n  - [UMG with C++](#umg-with-c)\n  - [UI Tweening Library](#ui-tweening-library)\n- [📚 Create custom module](#-create-custom-module)\n  - [Module structure](#module-structure)\n  - [Module code](#module-code)\n  - [♻️ Circular Dependency](#-circular-dependency)\n- [💡 Create custom plugin](#-create-custom-plugin)\n- [📝 Preprocessor](#-preprocessor)\n  - [Pragma once](#pragma-once)\n  - [Strip out editor functionality](#strip-out-editor-functionality)\n- [🦄 Units](#-units)\n  - [Use cases with UHT](#use-cases-with-uht)\n  - [Use cases with code](#use-cases-with-code)\n- [🎨 Draw Debug Shapes](#-draw-debug-shapes)\n  - [Draw a point](#draw-a-point)\n  - [Draw a sphere](#draw-a-sphere)\n  - [Draw a circle](#draw-a-circle)\n  - [Draw a circle arc](#draw-a-circle-arc)\n  - [Draw a 2D donut](#draw-a-2d-donut)\n  - [Draw a solid box](#draw-a-solid-box)\n  - [Draw a wired box](#draw-a-wired-box)\n  - [Draw a cylinder](#draw-a-cylinder)\n  - [Draw a capsule](#draw-a-capsule)\n  - [Draw a cone](#draw-a-cone)\n  - [Draw a plane](#draw-a-plane)\n  - [Draw a line](#draw-a-line)\n  - [Draw an arrow](#draw-an-arrow)\n  - [Draw a crosshair](#draw-a-crosshair)\n  - [Draw a camera](#draw-a-camera)\n  - [Draw a mesh](#draw-a-mesh)\n  - [Draw a string:](#draw-a-string)\n  - [Draw a centripetal catmull-rom spline](#draw-a-centripetal-catmull-rom-spline)\n- [⚡ Compiling a plugin](#-compiling-a-plugin)\n- [⏳ Gameplay Timers](#-gameplay-timers)\n- [🧵 Gameplay Tags](#-gameplay-tags)\n- [Usage](#usage)\n- [Data types](#data-types)\n- [Code](#code)\n- [🧠 Multithreading and Asynchronous Tasks](#-multithreading-and-asynchronous-tasks)\n  - [Multithreading](#multithreading)\n  - [Runnables](#runnables)\n  - [Tasks](#tasks)\n    - [AsyncTask](#asynctask)\n    - [ParallelFor](#parallelfor)\n    - [FNonAbandonableTask](#fnonabandonabletask)\n- [🎯 Extend Unreal Editor](#-extend-unreal-editor)\n  - [Slate](#slate)\n  - [Creating custom asset type](#creating-custom-asset-type)\n- [⚠️ Common Issues](#-common-issues)\n  - [⛔ Compiler Errors](#-compiler-errors)\n    - [Compiler Error C2007](#compiler-error-c2007)\n    - [Compiler Error C2065](#compiler-error-c2065)\n    - [Compiler Error C2628](#compiler-error-c2628)\n  - [💣 Runtime Errors](#-runtime-errors)\n  - [💀 Semantic Errors](#-semantic-errors)\n    - [💠 Integer overflow](#-integer-overflow)\n    - [💠 Array overflow](#-array-overflow)\n    - [🔍 Scope issues](#-scope-issues)\n- [🐣 Tips and best practices](#-tips-and-best-practices)\n  - [Disable BlueprintPure](#disable-blueprintpure)\n  - [Switch case fall-through](#switch-case-fall-through)\n  - [📦 Refactoring](#-refactoring)\n    - [Renaming](#renaming)\n    - [Extract Method](#extract-method)\n    - [Typedefs](#typedefs)\n    - [Introduce Variable](#introduce-variable)\n    - [Invert 'if' statement to reduce nesting](#invert-if-statement-to-reduce-nesting)\n  - [⏱ Ticking](#-ticking)\n    - [For actors](#for-actors)\n    - [For components](#for-components)\n    - [If you have to use tick](#if-you-have-to-use-tick)\n    - [`FTickFunction`](#ftickfunction)\n      - [MyTickableThing.h](#mytickablethingh)\n      - [MyTickableThing.cpp](#mytickablethingcpp)\n  - [🔌 Direct references](#-direct-references)\n- [🗝️ Deep dive](#-deep-dive)\n  - [K2Node](#k2node)\n  - [➗ Math Expression Node](#-math-expression-node)\n  - [Call function in editor](#call-function-in-editor)\n  - [Call function via Console Commands](#call-function-via-console-commands)\n  - [Renaming variables without breaking references](#renaming-variables-without-breaking-references)\n  - [Sampling a curve](#sampling-a-curve)\n  - [HTTP requests](#http-requests)\n  - [Encryption and Decryption](#encryption-and-decryption)\n- [🔗 Helpful Links](#-helpful-links)\n  - [YouTube Videos](#youtube-videos)\n  - [Articles](#articles)\n  - [Online Tools](#online-tools)\n  - [Misc](#misc-1)\n- [🆘 Support](#-support)\n- [📍 Footnotes](#-footnotes)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n## 👑 Cheatsheets\n\n\u003cdetails open\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\n![jbtronics - CheatSheet Poster](static/img/CheatSheet_Poster-1.png)[jbtronics - CheatSheet Poster](https://github.com/jbtronics/UE4-CheatSheet/blob/master/CheatSheet_Poster.pdf)\n\n![Winslow - Unreal Engine 5 Blueprint CheatSheet Dark Theme](static/img/unreal-engine-5-blueprint-cheat-sheet-dark-theme-1.png)[Winslow - Unreal Engine 5 Blueprint CheatSheet Dark Theme](https://uecasts.com/resources/unreal-engine-5-blueprint-cheat-sheet-dark-theme?utm_source=epicgames\u0026utm_campaign=cheat_sheet_ue5\u0026utm_content=blueprint_dark)\n\n![Winslow - Unreal Engine 5 C++ CheatSheet Dark Theme](static/img/unreal-engine-5-c-plus-plus-cheat-sheet-dark-theme-1.png)[Winslow - Unreal Engine 5 C++ CheatSheet Dark Theme](https://uecasts.com/resources/unreal-engine-5-c-plus-plus-cheat-sheet-dark-theme?utm_source=epicgames\u0026utm_campaign=cheat_sheet_ue5\u0026utm_content=c_plus_plus_dark)\n\n![Winslow - Unreal Engine 5 Editor CheatSheet Dark Theme](static/img/unreal-engine-5-editor-cheat-sheet-dark-theme-1.png)[Winslow - Unreal Engine 5 Editor CheatSheet Dark Theme](https://uecasts.com/resources/unreal-engine-5-editor-hotkeys-cheat-sheet-dark-theme?utm_source=epicgames\u0026utm_campaign=cheat_sheet_ue5\u0026utm_content=hotkeys_dark)\n\n![VictoriaLyons - ProfilingCheatSheet](static/img/ProfilingCheatSheet-1.png)[VictoriaLyons - ProfilingCheatSheet](https://www.reddit.com/r/unrealengine/comments/gqi2xu/quick_performance_cheat_sheet/)\n\n\u003c/details\u003e\n\n## 🎩 Plugins\n\n\u003cdetails open\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\nOver these years, I found some awesome and helpful plugins for extending and improving my productivity.\n\nThe plugins that I recommend the most are: **Advanced Renamer**, **Game Input**, **Common Maps**, **Quick Actions**, **ActorLocker**, **FlatNodes**, **CrystalNodes**, **ALS** and **Audio Meters**.\n\nAnd here is a full list of plugins that I discovered so far:\n\n### Marketplace Plugins\n\n-   [Achievement System](https://www.unrealengine.com/marketplace/en-US/product/achievement-system-blueprint-compatible) (Easily define and manage achievements in any UE4 project).\n-   [Animate](https://www.unrealengine.com/marketplace/en-US/product/animate-curve-driven-animations) (Animate anything using Vector Curves).\n-   [Attachment Sync](https://www.unrealengine.com/marketplace/en-US/product/attachment-sync) (Ability to any weapon to have attachments).\n-   [Audio Metering Lite](https://www.unrealengine.com/marketplace/en-US/product/audio-metering-lite) (lets you analyze and meter Submixes).\n-   [Auto Size Comments](https://www.unrealengine.com/marketplace/en-US/product/auto-size-comments) (makes comment boxes auto resize to fit the nodes inside).\n-   [Blueprintable Developer Settings](https://www.unrealengine.com/marketplace/en-US/product/blueprintable-developer-settings) (access to work with config files through blueprints and editor, just like `UDeveloperSettings`).\n-   [Common Maps](https://www.unrealengine.com/marketplace/en-US/product/common-maps) (Allows you to quickly switch to the maps you use frequently in the project you are working on by storing them in a list).\n-   [Custom Details Sections](https://www.unrealengine.com/marketplace/en-US/product/custom-details-sections) (Organize the details panel by grouping your variables into custom sections).\n-   [DzX Radial Menu](https://www.unrealengine.com/marketplace/en-US/product/dzx-radial-menu-umg/questions) (The radial menu plugin gives complete freedom in widget design for pie chart looking widgets).\n-   [Enhanced Input Sequence](https://www.unrealengine.com/marketplace/en-US/product/enhanced-input-sequence) (allows you to process Input Actions and their sequences).\n-   [Extended Debug Library](https://www.unrealengine.com/marketplace/en-US/product/extended-debug-library) (Extends some of the native debugging functions, exposing more functionality).\n-   [File System Library](https://www.unrealengine.com/marketplace/en-US/product/file-system-library) (Open, Save, Copy, Move and delete files and directories in tranquillity).\n-   [Game Flow](https://www.unrealengine.com/marketplace/en-US/product/game-flow) (Allows user to create state machines and configure them for various reasons).\n-   [Gradient Generator](https://www.unrealengine.com/marketplace/en-US/product/gradient-generator) (helps you create complex gradients).\n-   [Live Blueprint Debugger](https://www.unrealengine.com/marketplace/en-US/product/live-blueprint-debugger) (Integrates the Blueprint Debugger's variables window directly into the Level Editor's details panel for any selected Actor that is an instance of a Blueprint class).\n-   [Outliner Shortcuts](https://www.unrealengine.com/marketplace/en-US/product/outliner-shortcuts) (Allows the binding of shortcuts to some basic World Outliner functions).\n-   [Project Acoustics](https://www.unrealengine.com/marketplace/en-US/product/project-acoustics-for-unreal-audio) (audio wave acoustics engine for adding accurate acoustics to your 3D environments).\n-   [Project Cleaner](https://www.unrealengine.com/marketplace/en-US/product/projectcleaner) (Remove unused assets and empty folders in project).\n-   [Quest Editor Plugin](https://www.unrealengine.com/marketplace/en-US/product/quest-editor-plugin) (manage and create quests and dialogs for NPCs, with very dynamic and customizable features).\n-   [Quick Actions](https://www.unrealengine.com/marketplace/en-US/product/quick-actions) (Find anything inside Unreal quick).\n-   [Regex in Blueprints](https://www.unrealengine.com/marketplace/en-US/product/regex-in-blueprints) (Regular expressions available for blueprints).\n-   [Restart Unreal Editor](https://www.unrealengine.com/marketplace/en-US/product/restart-editor-01) (Utility to restart the Unreal Editor with a click or with a shortcut).\n-   [Screen Fade Library](https://www.unrealengine.com/marketplace/en-US/product/screen-fade-library) (Plugin that makes it easy to implement screen fade in Blueprints and C++).\n-   [SweejTech Audio Inspector](https://www.unrealengine.com/marketplace/en-US/product/sweejtech-audio-inspector) (Allows you to see a detailed, useful info about all active sounds in game in a compact editor tab window).\n-   [Time Clock](https://www.unrealengine.com/marketplace/en-US/product/time-clock) (Easily track how long you have to work in a project, and manage your times with alarms).\n-   [Universal Camera](https://www.unrealengine.com/marketplace/en-US/product/universal-camera) (A flexible camera for your games).\n\n### Github Plugins\n\n-   [ActorLocker](https://github.com/Gradess2019/ActorLocker) (Ability to lock actors while editing the level).\n-   [Advanced Locomotion System Refactored](https://github.com/Sixze/ALS-Refactored) (C++ version).\n-   [Agora Static Mesh Thumbnail Renderer](https://github.com/ryanjon2040/AgoraStaticMeshThumbnailRenderer) (Provides some information about Static Mesh in Content Browser).\n-   [Aliaser](https://github.com/AyeTSG/Aliaser) (Allows aliases to be shown in the Content Browser).\n-   [ALS-Refactored XT](https://github.com/Voidware-Prohibited/ALSXT) (Expand ALS Refactored with expanded Character States, Improved Foot Print system, Sliding, Vaulting and Wallrunning).\n-   [AsyncLoadingScreen](https://github.com/truong-bui/AsyncLoadingScreen) (Ability to add custom loading screen).\n-   [Audio Analysis Tools](https://github.com/gtreshchev/AudioAnalysisTools) (Provides a variety of functions for analyzing audio data. Works in conjunction with the Runtime Audio Importer plugin).\n-   [Audio Meters for Unreal Engine 5.1](https://michaelgarydean.itch.io/audio-metering-editor-utility-widget) (Ability to monitoring your audio levels).\n-   [Batch Rename Tool](https://github.com/FrozenStormInteractive/Unreal-Batch-Rename-Tool) (rename multiple assets quickly with a set of naming rules).\n-   [BlueprintUE C++](https://github.com/blueprintue/blueprintue-cpp-plugin) (Allows you to send your blueprints on [](https://blueprintUE.com) associated to your account).\n-   [BUI Cheat Manager](https://github.com/benui-dev/UE-BUICheatManager/) (Cheat manager, providing a way of defining cheat shortcut).\n-   [Circular Dependencies Detector](https://github.com/bstt/CircularDependenciesDetector/).\n-   [CrystalNodes](https://github.com/SkylakeOfficial/CrystalNodes) (Beautify the unreal editor graph nodes).\n-   [CsToCpp](https://github.com/CSharpForUnrealEngine5/CsToCpp) (C# to UE C++ compiler).\n-   [CustomShapeButton](https://github.com/JanSeliv/CustomShapeButton) (Allows to make buttons of any shape in UE5.3).\n-   [Elementus Inventory](https://github.com/lucoiso/UEElementusInventory) (Data-Driven Inventory \u0026 Items system).\n-   [ExtendedUnreal](https://github.com/BenVlodgi/UE-ExtendedUnreal) (Exposes useful functions to Blueprints).\n-   [FlatNodes](https://github.com/brumenn/FlatNodes) (A minimalist style for Unreal Engine graph nodes).\n-   [FlowGraph](https://github.com/MothCocoon/FlowGraph) (Design-agnostic node system for scripting game’s flow).\n-   [Function Picker](https://github.com/JanSeliv/FunctionPicker) (Allows to choose a function right in the property from any blueprint in UE5.3).\n-   [Hotbar and Inventory System](https://github.com/finalstack/InventorySystem) (Easy to use Hotbar and Inventory system).\n-   [MDMetaDataEditor](https://github.com/DoubleDeez/MDMetaDataEditor) (Ability to edit metadata of Blueprint Properties, Functions, and Function and Event Parameters).\n-   [Neat Metadata](https://github.com/pramberg/NeatMetadata) (Allow various metadata to be used in Blueprints that is otherwise only available in C++.).\n-   [ObjectPool](https://github.com/dslabkowski/ObjectPool/) (Improve performance and memory use by reusing objects from a fixed pool instead of allocating and freeing them individually).\n-   [PBCharacterMovement](https://github.com/ProjectBorealis/PBCharacterMovement) (HL2-style, classic FPS movement for UE in C++).\n-   [Pool Manager](https://github.com/JanSeliv/PoolManager) (Helps reuse objects in UE5.3).\n-   [RefreshAllNodes](https://github.com/nachomonkey/RefreshAllNodes) (Ability to refresh all nodes in a single Blueprint Instance. Helpful when Blueprint version has not been updated to its counterpart of C++).\n-   [Serial Communication](https://github.com/videofeedback/Unreal_Engine_SerialCOM_Plugin) (Serial Com Port Library).\n-   [Settings Widget Constructor](https://github.com/JanSeliv/SettingsWidgetConstructor) (Automated UI generation of game settings from data table in UE5.3).\n-   [Subsystem Browser Plugin](https://github.com/aquanox/SubsystemBrowserPlugin/) (Adds a Subsystem Browser panel to explore running subsystems and edit their properties).\n-   [TabRestore](https://github.com/Theliraan/TabRestore) (restore closed tabs).\n-   [UI Tweening Library for UE4/UMG](https://github.com/benui-dev/UE-BUITween).\n-   [Unreal Blueprint CSV Parsing](https://github.com/IncantaGames/unreal-bp-csv-parsing).\n-   [UnrealImGui](https://github.com/benui-dev/UnrealImGui) (Integrates [Dear ImGui](https://github.com/ocornut/imgui) framework into Unreal Engine).\n-   [VoxelCore](https://github.com/VoxelPlugin/VoxelCore) (Use voxel inside UE).\n\n### Epic Games Plugins\n\n-   [Advanced Renamer](https://dev.epicgames.com/documentation/en-us/unreal-engine) made by Epic Games.\n-   [Game Input](https://dev.epicgames.com/documentation/en-us/unreal-engine) made by Epic Games.\n-   [Chaos Vehicles](https://dev.epicgames.com/documentation/en-us/unreal-engine/vehicles-in-unreal-engine) made by Epic Games (Vehicle System).\n-   [Common UI](https://dev.epicgames.com/documentation/en-us/unreal-engine/common-ui-plugin-for-advanced-user-interfaces-in-unreal-engine) made by Epic Games. ​\n-   [Enhanced Input](https://dev.epicgames.com/documentation/en-us/unreal-engine/enhanced-input-in-unreal-engine) made by Epic Games.\n-   [Sun Position Calculator](hhttps://dev.epicgames.com/documentation/en-us/unreal-engine/geographically-accurate-sun-positioning-tool-in-unreal-engine) made by Epic Games (Real-time sky).\n\n### MrRobinOfficial's Plugins\n\n-   [Common Time](https://github.com/MrRobinOfficial/Unreal-CommonTime) (Provides an editor view for editing DateTime and Timespan values).\n-   [Common Vehicle](https://github.com/MrRobinOfficial/Unreal-CommonVehicle) (Extend Chaos Vehicle System).\n-   [IniParser](https://github.com/MrRobinOfficial/Unreal-IniParser) (Import/export .ini files).\n\nI am planning to make more plugins, which you can find me on [Github](https://github.com/MrRobinOfficial).\n\n\u003c/details\u003e\n\n## 📛 Console Commands\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n* `stat fps`: Display FPS.\n* `stat unit`: Display frame time.\n* `stat game`: Display a general idea on how long the various gameplay ticks are taking.\n* `dumpticks`: Display a list of current actors, which currently ticks in the level.\n* `slomo`: To speed up or slow down the game time.\n* `obj list`: Display a list of current loaded objects.\n* `obj list class=BP_PlayerCharacter_C`: Same as `obj list` but with a filter.\n* `obj gc`: Collect all objects with GC (Garbage Collector).\n* `au.Debug.AudioSoloSoundWave`: Takes a sound wave name as an additional input, and toggles whether that sound wave is solo (the only audible sound).\n\nHere is also a [website](https://pongrit.github.io/) by Pongrit, which showcase all of Unreal Engine's console commands.\n\n## 📌 Shortcuts\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nTo change any of the shortcuts, you can access the keyboard shortcut settings via **Editor Preferences**, then under **General** select **Keyboard Shortcuts**.\n\n---\n\nBasic\n\n-   \u003ckbd\u003eCtrl + C\u003c/kbd\u003e: Copy\n-   \u003ckbd\u003eCtrl + X\u003c/kbd\u003e: Cut\n-   \u003ckbd\u003eCtrl + V\u003c/kbd\u003e: Paste\n-   \u003ckbd\u003eDel\u003c/kbd\u003e - Delete\n-   \u003ckbd\u003eCtrl + Y\u003c/kbd\u003e: Undo\n-   \u003ckbd\u003eCtrl + Z\u003c/kbd\u003e: Redo\n-   \u003ckbd\u003eCtrl + A\u003c/kbd\u003e: Select All\n-   \u003ckbd\u003eEsc\u003c/kbd\u003e: Clear Selection\n-   \u003ckbd\u003eUp/Down/Left/Right Arrow Keys\u003c/kbd\u003e: Move Selection\n-   \u003ckbd\u003eCtrl + Spacebar\u003c/kbd\u003e: Open Content Browser\n-   \u003ckbd\u003eCtrl + B\u003c/kbd\u003e: Find in Content Browser\n-   \u003ckbd\u003eCtrl + Tab\u003c/kbd\u003e: Browse Tabs\n-   \u003ckbd\u003eCtrl + O\u003c/kbd\u003e: Open Level\n-   \u003ckbd\u003eCtrl + P\u003c/kbd\u003e: Asset Picker\n-   \u003ckbd\u003eAlt + P\u003c/kbd\u003e or \u003ckbd\u003eAlt + S\u003c/kbd\u003e: Play/Simulate\n-   \u003ckbd\u003eP\u003c/kbd\u003e: Show Nav Mesh\n-   \u003ckbd\u003eMouse Wheel Up/Down\u003c/kbd\u003e: Zoom\n\n---\n\nOutliner\n\n-   \u003ckbd\u003eCtrl + G\u003c/kbd\u003e or \u003ckbd\u003eShift + G\u003c/kbd\u003e: Group/Ungroup\n-   \u003ckbd\u003eRight-Click\u003c/kbd\u003e on Group: Pin/Unpin\n\n---\n\nBlueprint editor\n\n-   \u003ckbd\u003eCtrl + S\u003c/kbd\u003e: Save Blueprint\n-   \u003ckbd\u003eCtrl + F\u003c/kbd\u003e: Find within Blueprint\n-   \u003ckbd\u003eCtrl + Shift + F\u003c/kbd\u003e: Find in all Blueprints\n\n---\n\nLevel editing\n\n-   \u003ckbd\u003eCtrl + S\u003c/kbd\u003e: Save All\n-   \u003ckbd\u003eEnd\u003c/kbd\u003e: Snap to Floor\n-   \u003ckbd\u003eAlt + End\u003c/kbd\u003e: Snap Pivot to Floor\n-   \u003ckbd\u003eShift + End\u003c/kbd\u003e: Snap Bounds to Floor\n-   \u003ckbd\u003eCtrl + End\u003c/kbd\u003e: Snap Origin to Grid\n-   \u003ckbd\u003eAlt + Transform\u003c/kbd\u003e: Duplicate and Transform\n\n---\n\nCamera/transformation\n\n-   \u003ckbd\u003eAlt + G\u003c/kbd\u003e: Perspective View\n-   \u003ckbd\u003eAlt + H\u003c/kbd\u003e: Front View\n-   \u003ckbd\u003eAlt + J\u003c/kbd\u003e: Top View\n-   \u003ckbd\u003eAlt + K\u003c/kbd\u003e: Side View\n-   \u003ckbd\u003eF\u003c/kbd\u003e: Focus\n-   \u003ckbd\u003eG\u003c/kbd\u003e: View\n-   \u003ckbd\u003eR\u003c/kbd\u003e: Scale\n-   \u003ckbd\u003eW\u003c/kbd\u003e: Translate\n-   \u003ckbd\u003eE\u003c/kbd\u003e: Rotate\n-   \u003ckbd\u003eSpacebar\u003c/kbd\u003e: Toggle Move/Rotate/Scale\n\n---\n\nTools\n\n-   \u003ckbd\u003eCtrl + Shift + Comma\u003c/kbd\u003e: GPU Visualizer\n\n## ⌛ Getting started with C++\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nHighly recommend taking a short class of native C++. Here is a video link to ~1h long [video tutorial from Mosh](https://www.youtube.com/watch?v=ZzaPdXTrSb8).\n\nYou can also watch a playlist from [GGameDev about getting started with Unreal Engine C++](https://youtube.com/playlist?list=PLaaDnVlfJwc4Lncf4XTYaTRG_osOk-T0N).\n\nC++ is a statically typed, compiled, general-purpose programming language that offers a combination of high-level and low-level features. It was developed by [Bjarne Stroustrup](https://en.wikipedia.org/wiki/Bjarne_Stroustrup) at Bell Labs in 1979 as an enhancement to the [C language](https://en.wikipedia.org/wiki/C_(programming_language)), originally named C[^10] with Classes and later renamed [C++](https://en.wikipedia.org/wiki/C%2B%2B) in 1983.\n\nYou can read more about [C++ Language Reference from Microsoft Learn](https://learn.microsoft.com/en-us/cpp/cpp/cpp-language-reference?view=msvc-170).\n\nUsing C++ with Unreal Engine unlocks the engine's full feature set, allowing developers to harness advanced graphics rendering, physics simulations, networking, and AI capabilities. C++ provides a level of control, customization, and performance optimization that complements visual scripting.\n\nDeveloping with C++ in Unreal Engine enables better debugging, profiling, and performance optimization through techniques such as multithreading and memory management. It also facilitates integration with third-party libraries, expanding the range of functionality and flexibility available to developers.\n\nYou can read more about it on [their docs](https://docs.unrealengine.com/5.2/en-US/unreal-engine-programming-and-scripting/).\n\nTo use C++ effectively in Unreal Engine, it is crucial to have a strong foundation in programming principles and understanding of Unreal Engine's architecture and conventions. Leveraging resources like the Unreal Engine documentation, community forums, and collaboration with other developers helps to gain knowledge and best practices.\n\n*By combining the power of C++ and Unreal Engine, developers can create immersive experiences and unlock the full potential of the engine's capabilities.*\n\n### 🌈 Integrated Development Environment\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nAn Integrated Development Environment (IDE) is a software application that provides comprehensive tools for writing, debugging, and managing code. IDEs offer a streamlined and feature-rich environment for software development, making it easier for developers to work on their projects efficiently.\n\nPopular IDEs used in Unreal Engine and C++ development include:\n\n* [Visual Studio](https://visualstudio.microsoft.com/): The Visual Studio IDE for Unreal Engine development. It offers a powerful set of C++ tools and seamless integration with Unreal Engine, providing a robust development environment. `Free`.\n\n* [Visual Studio Code (VSCode)](https://code.visualstudio.com/): Visual Studio Code is a lightweight, cross-platform code editor with a rich ecosystem of extensions, including ones for Unreal Engine development. `Free`.\n\n* [Rider](https://www.jetbrains.com/rider/): Rider is a popular IDE developed by JetBrains, designed for game development, and it offers solid integration with Unreal Engine projects. `Cost`.\n\n### ⛏️ Tools to help your journey\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nHere are some tools that can be integrated into your IDE's for better performance, debugging or writing good code practices.\n\n* [Visual Assist](https://www.wholetomato.com/): A productivity tool for refactoring, reading, writing, navigating and generating C/C++/C# code. `Cost` and for `VS`.\n\n* [UnrealMacroGenerator](https://marketplace.visualstudio.com/items?itemName=Naotsun.Naotsun-UE-UMG): Provides a macro editor used by Unreal C ++ of Unreal Engine. You can create macros and edit already written macros. `Free` and for `VS`.\n\n### 🟢 Benefits of using C++ with Unreal Engine\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n* High performance: C++ allows you to write code that can run directly on the CPU and GPU, making it possible to achieve very high performance levels in your game or application.\n\n* Integration with existing codebases: If you have existing C++ code that you want to integrate with your Unreal Engine project, using C++ allows you to do so more easily.\n\n* Access to low-level functionality: C++ gives you access to lower-level functionality than other programming languages, which can be especially useful in game development where fine-grained control over memory, data structures, and algorithms is often necessary.\n\n* Garbage Collection and Memory Management: While C++ demands manual memory management, Unreal Engine provides a [garbage collector](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)) that efficiently clears out `UObject` classes from memory. With the control over manual memory handling, you can precisely dictate when to allocate and deallocate memory as necessary.\n\n### 🔴 Drawbacks of using C++ with Unreal Engine\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n* More prone to errors: C++ is a strongly typed language, requiring the precise use of semicolons, braces and accurate syntax to ensure successful compilation. Rectifying these issues can be time-consuming. On the contrary, the Blueprint's node-based graph system operates without the need for \"correct\" syntax, offering a more \"forgiving\" environment.\n\n* Tied to Unreal's API: Throughout the evolution of Unreal Engine, Epic Games may modify the [source code](https://en.wikipedia.org/wiki/Source_code), rendering certain functions and members as **obsolete**/**deprecated**. Consequently, Unreal might recommend the need to update the codebase with the latest [API](https://en.wikipedia.org/wiki/API) changes. Failure to do so can lead to compilation errors, in the future.\n\n* Updating your codebase: When working with C++ and Unreal Engine, your C++ code is compiled into a [.DLL](https://en.wikipedia.org/wiki/Dynamic-link_library) (in Windows OS) file that Unreal Engine can read and use within Blueprint graphs. However, this necessitates Unreal Engine to reload to incorporate your code changes. Epic Games has introduced [Hot Reload](https://unrealcommunity.wiki/live-compiling-in-unreal-projects-tp14jcgs), allowing for code reloading without editor restart, streamlining the development process. While Hot Reload often works for a while, it is unreliable and frequently causes blueprint corruption or other issues.\n\n* Requires more storage: When working with C++ within Unreal Engine, it often involves using \"Editor Symbols for debugging,\" consuming approximately 60 GB of storage. Similarly, if you opt to build Unreal Engine from its source code (on their github page), you'll require around 200 GB of storage space.\n\n## 🌍 Summary of C++ and Programming World\n\nIf you wish to extend your knowledge about C++ and general programming principles and ideology, I highly recommend reading about this [section](https://github.com/MrRobinOfficial/Guide-UnrealEngine/blob/dev/README_CPP.md).\n\n## 🚧 Blueprint vs C++\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n[![Watch the video by Alex Forsythe](https://img.youtube.com/vi/VMZftEVDuCE/maxresdefault.jpg)](https://youtu.be/VMZftEVDuCE)\n\n**Choose C++** when you anticipate the need for interaction with other C++ code or require extensive control over low-level optimizations and memory management. C++ is well-suited for classes that require direct access to engine internals and efficient execution.\n\n**Use Blueprint** as an inherited class when you want to benefit from the visual scripting capabilities and quick prototyping offered by Blueprint, while still having the option to incorporate C++ code in the future. This allows for a flexible approach where you can leverage the power of Blueprint while having the ability to extend functionality with C++ when needed.\n\n## 🎪 Architecture\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n```mermaid\ngraph TD;\n    UObjectBase--\u003eUObjectBaseUtility;\n    UObjectBaseUtility--\u003eUObject;\n    UObject--\u003eUSubsystem;\n    USubsystem--\u003eUDynamicSubsystem;\n    USubsystem--\u003eUGameInstanceSubsystem;\n    USubsystem--\u003eULocalPlayerSubsystem;\n    USubsystem--\u003eUWorldSubsystem;\n    UObject--\u003eUBlueprintFunctionLibrary;\n    UObject--\u003eUEngine;\n    UEngine--\u003eUEditorEngine;\n    UEngine--\u003eUGameEngine;\n    UObject--\u003eUPlayer;\n    UPlayer--\u003eULocalPlayer;\n    UPlayer--\u003eUNetConnection;\n    UObject--\u003eUScriptViewportClient;\n    UScriptViewportClient--\u003eUGameViewportClient;\n    UObject--\u003eUGameInstance;\n    UGameInstance--\u003eUPlatformGameInstance;\n    UObject--\u003eUWorld;\n    UObject--\u003eUPackage;\n    UObject--\u003eULevel;\n    UObject--\u003eUInterface;\n    UObject--\u003eUSoundBase;\n    USoundBase--\u003eUSoundCue;\n    USoundBase--\u003eUSoundWave;\n    UObject--\u003eUFXSystemAsset;\n    UFXSystemAsset--\u003eUParticleSystem;\n    UObject--\u003eUAnimationAsset;\n    UAnimationAsset--\u003eUAnimSequenceBase;\n    UAnimSequenceBase--\u003eUAnimSequence;\n    UObject--\u003eUTexture;\n    UTexture--\u003eUTexture2D;\n    UTexture--\u003eUMediaTexture;\n    UObject--\u003eUMaterial;\n    UObject--\u003eUVisual;\n    UVisual--\u003eUWidget;\n    UWidget--\u003eUUserWidget;\n    UUserWidget--\u003eUEditorUtilityWidget;\n    UObject--\u003eUDataAsset;\n    UDataAsset--\u003eUPrimaryDataAsset;\n    UObject--\u003eAActor;\n    AActor--\u003eAInfo;\n    AInfo--\u003eAGameSession;\n    AInfo--\u003eAGameModeBase;\n    AGameModeBase--\u003eAGameMode;\n    AInfo--\u003eAGameStateBase;\n    AGameStateBase--\u003eAGameState;\n    AInfo--\u003eAGameNetworkManager;\n    AInfo--\u003eAWorldSettings;\n    AInfo--\u003eAPlayerState;\n    AActor--\u003eALevelScriptActor;\n    AActor--\u003eAHUD;\n    AActor--\u003eAPlayerCameraManager;\n    AActor--\u003eAController;\n    AController--\u003eAAIController;\n    AController--\u003eAPlayerController;\n    AActor--\u003eAPawn;\n    APawn--\u003eADefaultPawn;\n    APawn--\u003eACharacter;\n    UObject--\u003eUActorComponent;\n    UActorComponent--\u003eUMovementComponent;\n    UActorComponent--\u003eUSceneComponent;\n    USceneComponent--\u003eUAudioComponnent;\n    USceneComponent--\u003eUCameraComponent;\n    USceneComponent--\u003eULightComponentBase;\n    USceneComponent--\u003eUPrimitiveComponent;\n    UPrimitiveComponent--\u003eUMeshComponent;\n    UMeshComponent--\u003eUStaticMeshComponent;\n    UMeshComponent--\u003eUSkinnedMeshComponent;\n    USkinnedMeshComponent--\u003eUSkeletalMeshComponent;\n    UMeshComponent--\u003eUWidgetComponent;\n    UPrimitiveComponent--\u003eUShapeComponent;\n    UShapeComponent--\u003eUBoxComponent;\n    UShapeComponent--\u003eUCapsuleComponent;\n    UShapeComponent--\u003eUSphereComponent;\n```\n\nWhen getting started with Unreal Engine and their workflow, it can be intimidating to a class, since there are so many and with different purpose. However, I would argue it too helps grow your skills and experience by learning Unreal's architecture.\n\nNot only do gain knowledge about Unreal, but also how a game engine could work under the hood. Compare to Unity, which is a [closed source](https://en.wikipedia.org/wiki/Proprietary_software) engine and their \"architecture\" is quite open to interpretation.\n\nUnreal Engine was also built for creating an FPS multiplayer game. You can find some classes, which were intentionally designed for that FPS game, such as `AGameState` and `APlayerState` classes. Which are classes that keep track of match points and health points.\n\nHowever, you can still use Unreal's architecture for different game genres. Unreal Engine works both for multiplayer and single player games.\n\nUnreal has too many classes, which would take a very long time to explain each one of them. However, there are a couple of important classes, that I should mention:\n\n\u003cdetails open\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\n-   [UClass](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/UClass) inherit `UStruct`\n\n    -   An object class.\n\n-   [UObject](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/UObject) inherit `UObjectBaseUtility`\n\n    -   The base class of all UE objects.\n    -   The type of an object is defined by its `UClass`.\n    -   This provides support functions for creating and using objects, and virtual functions that should be overridden in child classes.\n\n-   [AActor](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/AActor) inherit `UObject`\n\n    -   Actor is the base class for an Object that can be placed or spawned in a level.\n    -   Actors may contain a collection of ActorComponents, which can be used to control how actors move, how they are rendered, etc. The other main function of an Actor is the replication of properties and function calls across the network during play.\n    -   `AActor` itself doesn't have a transform (i.e. position in the world), it depends on the transform of the root component.\n    -   _Common Functions_:\n        -   `void PreInitializeComponents()` - Called before InitializeComponent is called on the actor's components. This is only called during gameplay and in certain editor preview windows.\n        -   `void InitializeComponent()` - This will be called only if the component has bWantsInitializeComponentSet. This only happens once per gameplay session.\n        -   `void PostInitializeComponents()` - Called after the actor's components have been initialized, only during gameplay and some editor previews.´\n        -   `void BeginPlay()` - Called when the level starts ticking, only during actual gameplay. This normally happens right after PostInitializeComponents but can be delayed for networked or child actors.\n        -   `void Tick(float DeltaSeconds)` - Function called every frame on this Actor.\n        -   `void EndPlay(const EEndPlayReason::Type EndPlayReason)` - Overridable function called whenever this actor is being removed from a level\n        -   `void SetLifeSpan(float InLifespan)` - Set the lifespan of actor.\n        -   `void Destroy(bool bNetForce, bool bShouldModifyLevel)` - Destroy the actor.\n        -   `void SetActorTickEnabled(bool bEnabled)` - Set this actor's tick functions to be enabled or disabled.\n        -   `void SetActorTickInterval(float TickInterval)` - Sets the tick interval of this actor's primary tick function.\n\n-   [APawn](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/APawn) inherit `AActor`\n\n    -   Pawn is the base class of all actors that can be possessed by players or AI. They are the physical representations of players and creatures in a level.\n    -   `APawn` provides basic possession mechanisms and support for input handling, as well as collision detection and physics simulation.\n    -   _Common Functions_:\n        -   `void BeginPlay()` - Called when the level starts ticking, only during actual gameplay.\n        -   `void Tick(float DeltaSeconds)` - Update function, called every frame on Actor.\n        -   `void EndPlay(const EEndPlayReason::Type EndPlayReason)` - Whenever actor is being removed from a level\n        -   `void SetLifeSpan(float InLifespan)` - Set the lifespan of actor.\n        -   `void Destroy(bool bNetForce, bool bShouldModifyLevel)` - Destroy actor.\n\n-   [AHUD](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/AHUD) inherit `AActor`\n\n    -   Base class of the heads-up display. The HUD displays important information to the player, such as health and ammunition levels, as well as providing visual feedback for game events such as damage or power-up pickups.\n    -   This has a canvas and a debug canvas on which primitives can be drawn. It also contains a list of simple hit boxes that can be used for simple item click detection. A method of rendering debug text is also included. Provides some simple methods for rendering text, textures, rectangles and materials which can also be accessed from blueprints.\n\n-   [ACharacter](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/ACharacter) inherit `APawn`\n\n    -   Characters are Pawns (`APawn`) that have a mesh, collision, and built-in movement logic.\n    -   They are responsible for all physical interaction between the player or AI and the world, and also implement basic networking and input models. They are designed for a vertically-oriented player representation that can walk, jump, fly, and swim through the world using `UCharacterMovementComponent`.\n    -   `ACharacter` can be used as a base class for player characters, enemies, and other types of characters in the game.\n\n-   [AController](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/AController) inherit `AActor`\n\n    -   Controllers are non-physical actors that can possess a Pawn to control its actions. PlayerControllers are used by human players to control pawns, while AIControllers implement the artificial intelligence for the pawns they control. Controllers take control of a pawn using their `Possess()` method, and relinquish control of the pawn by calling `UnPossess()`.\n    -   Controllers receive notifications for many of the events occurring for the Pawn they are controlling. This gives the controller the opportunity to implement the behavior in response to this event, intercepting the event and superseding the Pawn's default behavior.\n    -   ControlRotation (accessed via `GetControlRotation()`), determines the viewing/aiming direction of the controlled Pawn and is affected by input such as from a mouse or gamepad.\n\n-   [UActorComponent](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Components/UActorComponent) inherit `UObject`\n\n    -   ActorComponent is the base class for components that define reusable behavior that can be added to different types of Actors.\n    -   ActorComponents that have a transform are known as SceneComponents (`USceneComponent`) and those that can be rendered are PrimitiveComponents (`UPrimitiveComponent`).\n    -   `UActorComponent` doesn't appear in the world.\n    -   _Common Functions_:\n        -   `void BeginPlay()` - Begins Play for component.\n        -   `void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)` - Function called every frame on ActorComponent.\n        -   `void EndPlay(const EEndPlayReason::Type EndPlayReason)` - Ends gameplay for component.\n\n-   [UMovementComponent](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/UMovementComponent) inherit `UActorComponent`\n\n    -   MovementComponent is an abstract component class that defines functionality for moving a PrimitiveComponent (our UpdatedComponent) each tick.\n\n-   [USceneComponent](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Components/USceneComponent) inherit `UActorComponent`\n\n    -   A SceneComponent has a transform and supports attachment, but has no rendering or collision capabilities.\n    -   Useful as a 'dummy' component in the hierarchy to offset others.\n    -   It's used by components that need to know its place in the world to run the logic, i.e. `UAudioComponnent`, `UCameraComponent`.\n\n-   [UPrimitiveComponent](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Components/UPrimitiveComponent) inherit `USceneComponent`\n\n    -   PrimitiveComponents are SceneComponents that contain or generate some sort of geometry, generally to be rendered or used as collision data.\n    -   There are several subclasses for the various types of geometry, but the most common by far are the ShapeComponents (Capsule, Sphere, Box), StaticMeshComponent, and SkeletalMeshComponent.\n    -   ShapeComponents generate geometry that is used for collision detection but are not rendered, while StaticMeshComponents and SkeletalMeshComponents contain pre-built geometry that is rendered, but can also be used for collision detection.\n\n-   [USubsystem](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Subsystems/USubsystem) inherit `UObject`\n\n    -   Subsystems are auto instanced classes that share the lifetime of certain engine constructs.\n    -   Subsystems are responsible for initializing, updating, and shutting down their associated services, and can be used to customize or extend engine functionality as needed.\n    -   6 types of subsystems\n        -   [UEngineSubsystem](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Subsystems/UEngineSubsystem) Share lifetime of Engine.\n        -   [UEditorSubsystem](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Editor/EditorSubsystem/UEditorSubsystem) - Share the lifetime of the Editor.\n        -   [UGameInstanceSubsystem](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Subsystems/UGameInstanceSubsystem) Share lifetime of game instance.\n        -   [ULocalPlayerSubsystem](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Subsystems/ULocalPlayerSubsystem) - Share lifetime of local players.\n        -   [UWorldSubsystem](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Subsystems/UWorldSubsystem) - Share lifetime of a `UWorld`.\n        -   [UTickableWorldSubsystem](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Subsystems/UTickableWorldSubsystem) - Share lifetime of a `UWorld` and are ticking along with it.\n\n-   [UBlueprintFunctionLibrary](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Kismet/UBlueprintFunctionLibrary) inherit `UObject`\n\n    -   This class is a base class for any function libraries exposed to blueprints.\n    -   Methods in subclasses are expected to be static, and no methods should be added to this base class.\n\n-   [UEngine](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/UEngine), [UEditorEngine](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Editor/UnrealEd/Editor/UEditorEngine) and [UGameEngine](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/UGameEngine) inherit `UObject`\n\n    -   Abstract base class of all Engine classes, responsible for management of systems critical to editor or game systems. Also defines default classes for certain engine systems.\n    -   `UGameEngine` manages core systems that enable a game.\n    -   `UEditorEngine` drives the Editor. Separate from `UGameEngine` because it may have much different functionality than desired for an instance of a game itself.\n\n-   [UGameViewportClient](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/UGameViewportClient) inherit `UScriptViewportClient`\n\n    -   A game viewport (FViewport) is a high-level abstract interface for the platform specific rendering, audio, and input subsystems.\n    -   Exactly one GameViewportClient is created for each instance of the game.\n\n-   [ULocalPlayer](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/ULocalPlayer) inherit `UObject`\n\n    -   Each player that is active on the current client/listen server has a LocalPlayer.\n    -   It stays active across maps, and there may be several spawned in the case of splitscreen/coop. There will be 0 spawned on dedicated servers.\n    -   LocalPlayer is often used in conjunction with other classes, such as `APlayerController`, to manage local player interactions with the game.\n    -   _Common Functions_:\n        -   `TSubsystemClass* GetSubsystem() const` - Get a Subsystem of specified type\n\n-   [UWorld](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/UWorld) inherit `UObject`\n\n    -   The World is the top level object representing a map or a sandbox in which Actors and Components will exist and be rendered.\n    -   A World can be a single Persistent Level with an optional list of streaming levels that are loaded and unloaded via volumes and blueprint functions or it can be a collection of levels organized with a World Composition.\n    -   In a standalone game, generally only a single World exists except during seamless area transitions when both a destination and current world exists. In the editor many Worlds exist: The level being edited, each PIE instance, each editor tool which has an interactive rendered viewport, and many more.\n    -   _Common Functions_:\n        -   `void SpawnActor()` or `void SpawnActorDeferred()` - Spawn an actor from it's class. Deferred method will allow you to set actor properties before it's spawned into the world.\n\n-   [ULevel](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/ULevel)\n\n    -   A Level is a collection of Actors (lights, volumes, mesh instances etc.). Multiple Levels can be loaded and unloaded into the World to create a streaming experience.\n\n-   [UGameInstance](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/UGameInstance) inherit `UObject`\n\n    -   High-level manager object for an instance of the running game. Spawned at game creation and not destroyed until game instance is shut down. Running as a standalone game, there will be one of these. Running in PIE (play-in-editor) will generate one of these per PIE instance.\n    -   The game instance can be used to manage persistent data and game state across levels, as well as to perform global game operations such as handling networking, input, and other system-level tasks.\n\n-   [AGameMode](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/AGameMode) inherit `AGameModeBase`\n\n    -   GameMode is a subclass of GameModeBase that behaves like a multiplayer match-based game.\n    -   It has default behavior for picking spawn points and match state. Or you define the rules and mechanics of a particular game mode, such as deathmatch or capture the flag.\n    -   If you want a simpler base, inherit from GameModeBase instead.\n    -   Each level (`ULevel`) in a game can have its own `AGameMode`, allowing for different game modes to be used in different levels.\n\n-   [AGameState](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/AGameState) inherit `AGameStateBase`\n\n    -   GameState is a subclass of GameStateBase that behaves like a multiplayer match-based game. It is tied to functionality in GameMode.\n    -   `AGameState` can also be used to synchronize game state across multiple clients in a networked game, ensuring that all players have an accurate view of the game world.\n\n-   [APlayerState](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/APlayerState) inherit `AInfo`\n\n    -   A PlayerState is created for every player on a server (or in a standalone game).\n    -   PlayerStates are replicated to all clients, and contain network game relevant information about the player, such as playername, score, etc.\n\n-   [UWidget](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/UMG/Components/UWidget) inherit `UVisual`\n\n    -   This is the base class for all wrapped Slate controls that are exposed to UObjects.\n\n-   [UUserWidget](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/UMG/Blueprint/UUserWidget) inherit `UWidget`\n\n    -   A widget that enables UI extensibility through WidgetBlueprint.\n    -   `UUserWidget` provides a flexible framework for creating UI elements such as buttons, text fields, and images, and can be customized to implement complex UI behaviors such as animations, transitions, and data binding.\n\n-   [UAssetManager](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/UAssetManager) inherit `UObject`\n\n    -   A singleton `UObject` that is responsible for loading and unloading PrimaryAssets, and maintaining game-specific asset references Games should override this class and change the class reference\n\n-   [UDataAsset](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/UDataAsset) inherit `UObject`\n\n    -   Create a simple asset that stores data related to a particular system in an instance of this class.\n    -   Assets can be made in the Content Browser using any native class that inherits from this.\n    -   If you want data inheritance or a complicated hierarchy, Data Only Blueprint Classes should be created instead.\n\n-   [UPrimaryDataAsset](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/UPrimaryDataAsset) inherit `UDataAsset`\n\n    -   A DataAsset that implements `GetPrimaryAssetId()` and has asset bundle support, which allows it to be manually loaded/unloaded from the AssetManager (`UAssetManager`).\n    -   Represents a primary data asset in the engine. A primary data asset is a piece of game content that is created in the Unreal Editor, such as a mesh, texture, sound, or level. `UPrimaryDataAsset` provides a base class for creating custom data assets that can be loaded and used by the game at runtime.\n    -   `UPrimaryDataAsset` can be used to manage and organize game content, and can be customized to provide additional functionality such as data validation and metadata management.\n\n-   [USoundBase](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Sound/USoundBase) inherit `UObject`\n\n    -   The base class for a playable sound object\n    -   `USoundBase` can be used to play sound effects, music, and other audio in the game world.\n    -   `USoundBase` provides a number of features for controlling the playback of audio, including volume, pitch, and spatialization effects such as 3D sound and reverb.\n\n-   [UMaterial](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Materials/UMaterial) inherit `UMaterialInterface`\n\n    -   A Material is an asset which can be applied to a mesh to control the visual look of the scene.\n    -   When light from the scene hits the surface, the shading model of the material is used to calculate how that light interacts with the surface.\n\n-   [UMaterialInstance](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Materials/UMaterialInstanceDynamic) inherit `UMaterialInterface`\n\n    -   A instance of a material asset. This way, you can create a hierarchy material system.\n\n-   [UMaterialInstanceDynamic](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Materials/UMaterialInstanceDynamic) inherit `UMaterialInstance`\n\n    -   A dynamic spawned instance material.\n\n-   [UTexture](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/UTexture) inherit `UObject`\n\n    -   Represents an image or texture that can be used in the engine for various purposes such as materials or user interface elements.\n\n-   [UTexture2D](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/UTexture2D) inherit `UTexture`\n    -   Represents an 2D image or texture that can be used in the engine for various purposes such as materials or user interface elements.\n\n\u003c/details\u003e\n\nYou can read more about [Unreal Architecture at their docs](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/ProgrammingWithCPP/UnrealArchitecture/).\n\nAnd for more information about Unreal's Architecture. Then I highly recommend, you can watch [underscore about Unreal Engine Architecture](https://www.youtube.com/watch?v=QcXHEsR0xHI) video.\n\nYou can also watch a video discussion about [Multiplayer Framework of Unreal Engine from Kekdot](https://www.youtube.com/watch?v=Hsr6mbNKBLU).\n\n\u003e [!NOTE]\n\u003e This architecture is based on a multiplayer game setup. However, if you are making a singleplayer game, then you can ignore some of classes. Mainly `APlayerState` and `AGameState` (as well as their base classes).\n\nYou can also watch [The Unreal Engine Game Framework: From int main() to BeginPlay by Alex Forsythe](https://www.youtube.com/watch?v=IaU2Hue-ApI), which he talks how Unreal starts your game/editor from the source code. And how these classes work with each other.\n\n## ⚓ Guidelines\n\nYou can find more information about Unreal Engine's guideline, both for [inside the editor](https://dev.epicgames.com/documentation/en-us/unreal-engine/recommended-asset-naming-conventions-in-unreal-engine-projects) (asset creation), but also their [coding standard](https://dev.epicgames.com/documentation/en-us/unreal-engine/epic-cplusplus-coding-standard-for-unreal-engine).\n\n### 🎳 Naming Convention\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n![Naming Conventions](static/img/Naming_conventions.png)\n\nThere is a github repo, which talks about Unreal's naming convention. The repo is very detailed and explains how you should name your assets, as well as your code. Repo is called [Unreal Engine's style guide by Michael Allar](https://github.com/Allar/ue5-style-guide).\n\nUnreal Engine follows a specific naming convention that helps maintain consistency and readability in the codebase. When using Naming Conventions, all code and comments should use U.S. English spelling and grammar.\n\nPascal case is a naming convention used in programming and other contexts where compound words or phrases are created by capitalizing the first letter of each word and joining them without spaces. In Unreal Engine, pascal case is commonly used for naming classes, member variables, functions, and other constructs.\n\nIn Unreal Engine, the use of pascal case for classes is part of the naming convention for user-defined classes. When you create a new class in Unreal Engine, it is recommended to use pascal case for the class name. For example:\n\n```cpp\nclass AMyPlayerCharacter : public ACharacter\n{\n    // Class definition here\n};\n```\n\nSimilarly, pascal case is used for member variables and functions in Unreal Engine to maintain consistency and improve code readability. For example:\n\n```cpp\nclass AMyPlayerCharacter : public ACharacter\n{\npublic:\n    UPROPERTY()\n    float MovementSpeed;\n\n    UFUNCTION()\n    void Jump();\n};\n```\n\nBoolean variables, which uses a prefix of `b` followed by a descriptive name in pascal case.\nFor example, a boolean variable that controls whether a character is running might be named: `bIsRunning`.\n\nVariable, method, and class names should be:\n\n-   Clear\n-   Unambiguous\n-   Descriptive\n\nThe greater the scope of the name, the greater the importance of a good, descriptive name. Avoid over-abbreviation.\n\n```cpp\n// what does true mean?\nbool CheckTea(FTea Tea);\n\n// name makes it clear true means tea is fresh\nbool IsTeaFresh(FTea Tea);\n```\n\n#### 🎨 Abbreviations, Acronyms and Synonyms\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\nCommon Language features\n\n-   `arg` - Argument\n-   `arr` - Array\n-   `async` - Asynchronous\n-   `attr` - Attribute\n-   `auth` - Authentication\n-   `btn` - Button\n-   `buff` - Buffer\n-   `ctx` - Context\n-   `const` - Constant\n-   `db` - Database\n-   `dest` - Destination\n-   `desc` - Description\n-   `doc` or `docs` - Documentation\n-   `dir` - Direction or Directory (depending on the context)\n-   `elem` - Element\n-   `err` - Error\n-   `e` or `evt` - Event\n-   `exe` - Execution\n-   `expr` - Expression\n-   `ext` - Extension\n-   `func` - Function\n-   `fmt` - Format\n-   `gen` - Generation\n-   `hex` - Hexadecimal\n-   `impl` - Implementation\n-   `imp` - Import\n-   `i` or `idx` - Index\n-   `info` - Information\n-   `init` - initialization\n-   `it` or `iter` - Iterator\n-   `ident` - Identifier\n-   `lang` - Language\n-   `len` - Length\n-   `lvl` - Level\n-   `lib` - Library\n-   `loc` - Location\n-   `msg` - Message\n-   `num` - Number\n-   `obj` - Object\n-   `opt` - Option\n-   `out` - Output\n-   `pkg` - Package\n-   `param` - Parameter\n-   `px` - Pixel\n-   `pos` - Position\n-   `prev` - Previous\n-   `priv` - Private\n-   `pub` - Public\n-   `q` - Query\n-   `rand` - Random\n-   `rng` - Range\n-   `ref` - Reference\n-   `rm` or `rmv` - Remove\n-   `req` - Request\n-   `res` - Result or Response (depending on the context)\n-   `ret` - Return\n-   `sel` - Selection\n-   `sep` - Separator\n-   `sec` - Sequence\n-   `sol` - Solver\n-   `src` - Source\n-   `spec` - Specifier or Specification (depending on the context)\n-   `std` - Standard\n-   `stdio` - Standard Input Output\n-   `stmt` - Statement\n-   `stat` - Statistic\n-   `str` - String\n-   `sync` - Synchronization\n-   `tmp` - Temperature\n-   `temp` - Temporary\n-   `util` - Utility\n-   `val` - Value\n-   `var` - Variable\n-   `ws` - White space\n-   `win` - Windows\n-   `wiz` - Wizard\n\n---\n\nUnreal Engine features\n\n-   `PC` - Indicates that a variable is a **PlayerController**\n-   `LP` - Indicates that a variable is a **LocalPlayer**\n-   `Char` - Indicates that a variable is a **Character** (not to be confused about `char` data type)\n-   `Comp` - Indicates that a variable is a **component**\n-   `Ptr` - Indicates that a variable is a **pointer** to an object.\n-   `Ref` - Indicates that a variable is a **reference** to an object.\n-   `dt` - Delta Time\n\n---\n\nNetworking\n\n-   `OAuth` or Open Authentication – An open standard for authenticating applications or websites to access the content.\n-   `TCP` or Transmission Control Protocol – A standard defining how to exchange messages between systems.\n-   `UDP` or User Datagram Protocol – A standard defining how to exchange messages between systems.\n\n---\n\nTools/Frameworks\n\n-   `IDE` or Integrated Development Environment - A software application that provides facilities to programmers for software development.\n-   `JSON` or Javascript Object Notation – A file format, written with JavaScript[^14] notation, used widely for transferring data over the network.\n-   `XML` or Extensible Markup Language – A markup language used mainly for storing and transporting data.\n-   `SQL` or Structured Query Language – A query language for storage, retrieval, and modification of data.\n-   `CSV` or Comma-separated values - A CSV file is a delimited text file that uses a comma to separate values.\n\n---\n\nMath\n\n-   `add` - Addition\n-   `sub` - Subtraction\n-   `mul` - Multiplication\n-   `div` - Division\n-   `abs` - Absolute\n-   `sin` - Sinus\n-   `cos` - Cosinus\n-   `tan` - Tangens\n-   `rad` - Radian\n-   `r` - Radius\n-   `frac` - Fraction\n-   `freq` - Frequency\n-   `long` - Longitude or Longitudinal (depending on the context)\n-   `lat` - Latitude or Lateral (depending on the context)\n-   `sqrt` - Square Root\n-   `mod` - Modulo\n-   `min` - Minimum\n-   `max` - Maximum\n-   `lerp` - Linear Interpolation\n\n---\n\nMisc\n\n-   `API` or Application Programming Interface – An interface for connecting multiple isolated components.\n-   `SDK` or Software Development Kit – A collection of software often needed for development in a specific platform.\n-   `TDD` or Test-driven development - TDD is a software development process that is based on the repetition of a short development cycle: requirements are turned into specific test cases, and then the code is fixed so that the tests pass.\n-   `UUID` or Universally unique identifier - A UUID is a 128-bit number used to identify information in computer systems.\n-   `GUI` or Graphic User Interface - A GUI or graphical user interface is a form of user interface that allows users to interact with electronic devices through a graphical interface.\n-   `misc` - Miscellaneous\n-   `os` - Operating System\n-   `org` - Organization\n-   `pwr` - Power\n-   `pref` - Preference\n-   `repo` - Repository\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n#### Prefixes\n\n| Prefix | Class        | Subclasses                                                            |\n| ------ | ------------ | --------------------------------------------------------------------- |\n| U      | `UObject`    | `UActorComponent`, `UPrimaryDataAsset`, `UEngine`, `UGameplayStatics` |\n| A      | `AActor`     | `APawn`, `ACharaacter`, `AController`, `AHUD`, `AGameMode`            |\n| F      | Struct       | `FHitResult`, `FVector`, `FRotator`, `FTableRowBase`                  |\n| E      | Enum         | `EEnvQueryStatus`, `EConstraintType`, `EEndPlayReason`                |\n| I      | Inteface     | `IInputDevice`, `IHapticDevice`, `ITargetPlatform`                    |\n| T      | Template     | `TSubclassOf\u003cT\u003e`, `TArray\u003cT\u003e`, `TSet\u003cT\u003e`, `TMap\u003cT\u003e`, `TMultiMap\u003cT\u003e`   |\n| G      | Global Class | `GEngine`, `GConfig`, `GWorld`, `GEngineLoop`, `GIsEditor`            |\n\n\u003e [!TIP]\n\u003e Did you know that `F` prefix actually stands for `Float` (floating point). but it was inadvertently spread throughout and has lost its original meaning.\n\n### Coding standard\n\n\u003e Coding conventions are a set of guidelines for a specific programming language that recommend programming style, practices, and methods for each aspect of a program written in that language.\n\u003e\n\u003e These are guidelines for software structural quality. Software programmers are highly recommended to follow these guidelines to help improve the readability of their source code and make software maintenance easier.\n\u003e\n\u003e -- \u003ccite\u003e[Wikipedia](https://en.wikipedia.org/wiki/Coding_conventions)\u003c/cite\u003e\n\nEnumerated (Enum) classes are a replacement for old-style namespaced enums, both for regular enums and `UENUMs`. For example:\n\n```cpp\n// Old enum\nUENUM()\nnamespace EThing\n{\n    enum Type\n    {\n        Thing1,\n        Thing2\n    };\n}\n\n// New enum\nUENUM()\nenum class EThing : uint8\n{\n    Thing1,\n    Thing2\n}\n```\n\nEnums are supported as `UPROPERTYs`, and replace the old `TEnumAsByte\u003c\u003e` workaround. Enum properties can also be any size, not just bytes:\n\n```cpp\n// Old property\nUPROPERTY()\nTEnumAsByte\u003cEThing::Type\u003e MyProperty;\n\n// New property\nUPROPERTY()\nEThing MyProperty;\n```\n\n## 💎 Unreal Header Tool\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nUnreal Header Tool (UHT[^2]) is a code generator and reflection system in Unreal Engine. It processes special macros and meta tags in C++ header files and generates additional code to support Unreal Engine's reflection system, which enables various engine features like Blueprint integration, serialization, networking, and more.\n\nLayout:\n\n```cpp\nUPROPERTY([specifier1=setting1, specifier2, ...], [meta=(key1=\"value1\", key2=\"value2\", ...))])\nUFUNCTION([specifier1=setting1, specifier2, ...], [meta=(key1=\"value1\", key2=\"value2\", ...))])\nUCLASS([specifier1=setting1, specifier2, ...], [meta=(key1=\"value1\", key2=\"value2\", ...))])\nUSTRUCT([specifier1=setting1, specifier2, ...], [meta=(key1=\"value1\", key2=\"value2\", ...))])\nUENUM([specifier1=setting1, specifier2, ...])\nUPARAM([specifier1=setting1, specifier2, ...])\nUMETA([specifier1=setting1, specifier2, ...])\n```\n\n| Macro     | Description                                                                                                                                                       | Use Case                                                                                                             |\n| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |\n| UPROPERTY | Specifies properties of a class member, such as replication, serialization, editability, and blueprint visibility.                                                | Used to define properties of variables within a class to control how they are handled by Unreal Engine systems.      |\n| UFUNCTION | Identifies a C++ function that can be accessed and called from Blueprint visual scripting or other systems in Unreal Engine.                                      | Used to expose C++ functions to Blueprint for easy use in visual scripting and integration with Unreal Engine.       |\n| UCLASS    | Defines a C++ class that is exposed to Unreal Engine's reflection system, allowing it to be used in Blueprint and other engine features.                          | Used to define classes that can be used in Blueprint and integrated into Unreal Engine systems like the Editor.      |\n| USTRUCT   | Specifies a C++ struct that can be used with Unreal Engine's reflection system, making it usable in Blueprint and other engine features.                          | Used to define structs that can be used in Blueprint and integrated into Unreal Engine systems like the Editor.      |\n| UENUM     | Defines a C++ enumeration that can be used with Unreal Engine's reflection system, making it usable in Blueprint and other engine features.                       | Used to define enumerations that can be used in Blueprint and integrated into Unreal Engine systems like the Editor. |\n| UPARAM    | Specifies how a function parameter should be treated when used in Blueprint or other Unreal Engine systems.                                                       | Used to define parameter properties, such as Blueprint read/write access, in C++ functions exposed to Blueprint.     |\n| UMETA     | Provides additional metadata for UPROPERTY, UFUNCTION, UCLASS, USTRUCT, and UENUM, allowing customization of their behavior in Unreal Engine's reflection system. | Used to attach additional information or customizations to C++ entities exposed to Unreal Engine reflection.         |\n\n### UPROPERTY\n\n`UPROPERTY` is a macro used to declare a property within a class that needs to be exposed to the Unreal Engine's reflection system. It allows the property to be accessed and modified by the engine and Blueprint scripts.\n\n#### Specifiers\n\n-   `EditAnywhere`: Allows the property to be edited in the editor and during runtime for all instances of the class.\n\n-   `EditDefaultsOnly`: Permits editing the property only for the class's default object in the editor.\n\n-   `EditInstanceOnly`: Enables editing the property only for instances of the class during runtime.\n\n-   `VisibleAnywhere`: Displays the property value in the editor for all instances of the class.\n\n-   `VisibleDefaultsOnly`: Shows the property value in the editor for the class's default object.\n\n-   `VisibleInstanceOnly`: Displays the property value in the editor only for instances of the class.\n\n-   `BlueprintReadOnly`: Exposes the property to Blueprint scripts, but only for reading, not writing.\n\n-   `BlueprintReadWrite`: Exposes the property to Blueprint scripts for both reading and writing.\n\n-   `Category`: Organizes properties into named categories in the editor for better organization and readability.\n\n-   `EditFixedSize`: Specifies that an `TArray` or `TMap` property should be editable in the Details Panel of the editor with a fixed number of elements, preventing addition or removal.\n\n-   `Transient`: Indicates that a property should not be serialized, making it non-persistent and not saved when saving the state of the object.\n\n-   `Replicated`: Automatically replicates the property's value to clients in a multiplayer environment when the property changes on the server.\n\n-   `ReplicatedUsing`: Specifies a custom function that should be called on both the server and clients to handle replication of the property's value.\n\n-   `SimpleDisplay`: Indicates that the property's value should be displayed in a simple and concise manner in editor UI.\n\n-   `AdvancedDisplay`: Indicates that the property's value should be displayed with advanced options in editor UI.\n\n-   `Config`: Marks the property to be serialized to the project configuration file for external customization.\n\n-   `GlobalConfig`: Marks the property to be serialized to the global configuration file for external customization across all projects.\n\n#### Meta tags\n\n-   `DisplayName`: Sets a custom display name for the property in the editor.\n\n-   `Tooltip`: Provides a tooltip description for the property in the editor.\n\n-   `ClampMin`: Sets the minimum allowed value for the property in the editor.\n\n-   `ClampMax`: Sets the maximum allowed value for the property in the editor.\n\n-   `AllowPrivateAccess`: Allows access to private members within the class it belongs to.\n\n-   `Units`: Provides a human-readable unit label for the property in the editor.\n\n-   `ForceUnits`: Forces the units to be set. Rather than the editor deciding on what it wants instead.\n\n#### Examples\n\n```cpp\nUPROPERTY(EditAnywhere, Category=\"Hello|Cruel|World\")\nint32 EditAnywhereNumber;\n```\n\n```cpp\nUPROPERTY(Transient, Replicated)\nint32 CurrentHealth;\n\nUPROPERTY(Transient, ReplicatedUsing=OnArmorChanged)\nint32 CurrentArmor;\n\nUFUNCTION()\nvoid OnArmorChanged();\n```\n\n```cpp\nUPROPERTY(EditAnywhere, SimpleDisplay)\nint32 MaxHealth = 100;\n\nUPROPERTY(EditAnywhere, AdvancedDisplay)\nfloat HealthRegenerationTime = 5.0f;\n```\n\n```cpp\n// Must mark UCLASS with Config specifier\n\n// Config can be overriden from the base class.\nUPROPERTY(Config, BlueprintReadOnly)\nbool bRegenerateHealth;\n\n// GlobalConfig CANNOT be overridden from the base class.\nUPROPERTY(GlobalConfig, BlueprintReadOnly)\nbool bEnableHealthSimulation;\n```\n\n```cpp\nUPROPERTY(EditAnywhere, EditFixedSize)\nTArray\u003cFName\u003e Usernames = { TEXT(\"JohnDoe\"), TEXT(\"MrRobin\"), TEXT(\"JaneDoe\") };\n```\n\n```cpp\nUPROPERTY(EditAnywhere, meta=(Units=\"Celsius\"))\nfloat CookingTemperature;\n\nUPROPERTY(EditAnywhere, meta=(Units=\"Kilograms\"))\nfloat TigerWeight;\n\nUPROPERTY(EditAnywhere, meta=(Units=\"GB\"))\nfloat DiskSpace;\n\nUPROPERTY(EditAnywhere, meta=(Units=\"Percent\"))\nfloat Happiness;\n\nUPROPERTY(EditAnywhere, meta=(Units=\"times\"))\nfloat Deliciousness;\n```\n\nYou can read more about [UPROPERTY by BenUi](https://benui.ca/unreal/uproperty/).\n\n### UFUNCTION\n\n`UFUNCTION` is a macro used to declare a function within a class that needs to be exposed to the Unreal Engine's reflection system. It allows the function to be used in Blueprint scripts and network replication.\n\n#### Common Specifiers\n\n-   `BlueprintCallable`: Exposes the function to Blueprint scripts, allowing it to be called from within Blueprint graphs.\n\n-   `BlueprintPure`: Indicates that the function is a pure computation and does not modify any state, making it safe to use in Blueprint graphs without side effects.\n\n-   `BlueprintImplementableEvent`: Serves as a placeholder function in C++ that can be overridden and implemented in Blueprint.\n\n-   `BlueprintNativeEvent`: Similar to `BlueprintImplementableEvent`, but it also provides a C++ implementation that can be optionally overridden in Blueprint.\n\n-   `Category`: Organizes properties into named categories in the editor for better organization and readability.\n\n#### Common Meta tags\n\n-   `DisplayName`: Sets a custom display name for the function in the editor.\n\n-   `Tooltip`: Provides a tooltip description for the function in the editor.\n\n-   `ShortToolTip`: Provides a short tooltip description for the function in the editor.\n\n-   `AllowPrivateAccess`: Allows access to private members within the class it belongs to.\n\n-   `HideSelfPin`: Hides the \"self\" pin, which indicates the object on which the function is being called. The \"self\" pin is automatically hidden on `BlueprintPure` functions that are compatible with the calling Blueprint's Class. Functions that use the `HideSelfPin` Meta Tag frequently also use the `DefaultToSelf` Specifier.\n\n-   `BlueprintInternalUseOnly`: This function is an internal implementation detail, used to implement another function or node. It is never directly exposed in a Blueprint graph.\n\n-   `BlueprintProtected`: This function can only be called on the owning Object in a Blueprint. It cannot be called on another instance.\n\n-   `DeprecatedFunction`: Any Blueprint references to this function will cause compilation warnings telling the user that the function is deprecated. You can add to the deprecation warning message (for example, to provide instructions on replacing the deprecated function) using the `DeprecationMessage` metadata specifier.\n\n#### Examples\n\n```cpp\nUFUNCTION(BlueprintPure)\nint32 BlueprintPureFunction();\n\nUFUNCTION(BlueprintCallable)\nint32 BlueprintCallableFunction();\n\nUFUNCTION(BlueprintCallable)\nint32 BlueprintCallableConstFunction() const;\n\nUFUNCTION(BlueprintPure=false)\nint32 BlueprintPureFalseFunction() const;\n```\n\n```cpp\nUFUNCTION(BlueprintCallable, Category = \"Doggy Daycare\", meta=(ReturnDisplayName = \"Success\"))\nbool TryPetDog(const FName Name);\n```\n\nYou can read more about [UPROPERTY by BenUi](https://benui.ca/unreal/ufunction/).\n\n### UCLASS\n\n`UCLASS` is a macro used to declare a class that is intended to be used in Unreal Engine's reflection system. It allows the class to be instantiated, exposed to Blueprint, and used in various engine systems.\n\n#### Common Specifiers\n\n-   `Blueprintable`: Allows the class to be used as a blueprint in the editor.\n\n-   `BlueprintType`: Specifies that the class can be instantiated and manipulated in Blueprint scripts.\n\n-   `Abstract`: Indicates that the class is an abstract class and cannot be instantiated directly.\n\n-   `Transient`: Excludes the class from being serialized and saved in the game's persistent data.\n\n-   `MinimalAPI`: Restricts the class's visibility for export, making it more suitable for engine internal use.\n\n-   `NotBlueprintType`: Prevents the class from being used as a blueprint.\n\n#### Common Meta tags\n\n-   `DisplayName`: Sets a custom display name for the class in the editor.\n\n-   `ToolTip`: Provides a tooltip description for the class in the editor.\n\n-   `HideCategories`: Hides specific property categories from being displayed in the editor.\n\n-   `ClassGroup`: Assigns the class to a specific group in the editor's class picker.\n\n-   `IncludePath`: Specifies the include path for the generated code of the class.\n\n-   `BlueprintSpawnableComponent`: Marks a class derived from `USceneComponent` as spawnable in Blueprint.\n\n#### Examples\n\n```cpp\nUCLASS(Blueprintable)\nclass MyActor : public AActor\n{\n    GENERATED_BODY()\n\npublic:\n    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = \"MyActor\")\n    int32 MyIntProperty;\n\n    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = \"MyActor\")\n    float MyFloatProperty;\n\n    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = \"MyActor\")\n    FString MyStringProperty;\n\n    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = \"MyActor\")\n    FMyStruct MyStructProperty;\n};\n```\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nYou can read more about [UCLASS by BenUi](https://benui.ca/unreal/uclass/).\n\n### USTRUCT\n\n`USTRUCT` is a macro used to declare a C++ struct that is intended to be used in Unreal Engine's reflection system. It enables the struct to be used as a property within UCLASSes and exposed to Blueprint.\n\n#### Common Specifiers\n\n-   `BlueprintType`: Specifies that the structure can be used in Blueprint scripts.\n\n-   `Atomic`: Ensures that the structure is treated as an atomic type for replication in multiplayer games.\n\n-   `NotReplicated`: Excludes the structure from being replicated across the network.\n\n#### Common Meta tags\n\n-   `DisplayName`: Sets a custom display name for the structure in the editor.\n\n-   `ToolTip`: Provides a tooltip description for the structure in the editor.\n\n-   `Category`: Specifies the category in which the structure will appear in the editor.\n\n#### Examples\n\n```cpp\nUSTRUCT(BlueprintType)\nstruct FMyStruct\n{\n    GENERATED_BODY()\n\n    UPROPERTY(BlueprintReadWrite, Category = \"MyStruct\")\n    int32 Value1;\n\n    UPROPERTY(BlueprintReadWrite, Category = \"MyStruct\")\n    FString Value2;\n};\n```\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nYou can read more about [USTRUCT by BenUi](https://benui.ca/unreal/ustruct/).\n\n### UENUM\n\n`UENUM` is a macro used to declare an enumeration that is intended to be used in Unreal Engine's reflection system. It allows the enumeration to be exposed to Blueprint and used within `UCLASS`es.\n\n#### Common Specifiers\n\n-   `BlueprintType`: Specifies that the enumeration can be used in Blueprint scripts.\n\n-   `DisplayNames`: Specifies a list of custom display names for each enumeration value in the editor.\n\n#### Common Meta tags\n\n-   `DisplayName`: Sets a custom display name for the enumeration in the editor.\n\n-   `ToolTip`: Provides a tooltip description for the enumeration in the editor.\n\n-   `Hidden`: Hides the enumeration from being displayed in the editor.\n\n-   `Bitflags`: Indicates that the enumeration represents a set of bit flags.\n\n-   `EnumRange`: Specifies the minimum and maximum values for the enumeration.\n\n#### Examples\n\n```cpp\nUENUM(BlueprintType)\nenum class EWeaponType\n{\n    Sword         UMETA(DisplayName = \"Sword Weapon\"),\n    Axe           UMETA(DisplayName = \"Axe Weapon\"),\n    Bow           UMETA(DisplayName = \"Bow Weapon\"),\n    Wand          UMETA(DisplayName = \"Magic Wand\"),\n};\n```\n\nYou can read more about [UENUM by BenUi](https://benui.ca/unreal/uenum/).\n\n### UPARAM\n\n`UPARAM` is a macro used to provide additional information to the Unreal Header Tool. It is used with parameters of UFUNCTION and UPROPERTY to specify how the engine should handle the data.\n\n-   `UPARAM(Ref)`: Used to mark a parameter that is passed by reference. It ensures that the parameter is treated as a reference during code generation, which may affect how the engine handles the parameter.\n\n-   `UPARAM(DisplayName)`: Used to set a custom display name for a function parameter when it appears in the editor's Blueprint node graph.\n\n-   `UPARAM(BlueprintCallable, BlueprintPure)`: Used to apply multiple specifiers to a function parameter. For example, to mark a parameter as both BlueprintCallable and BlueprintPure.\n\n-   `UPARAM(meta = (CustomMetaTag))`: Allows developers to create custom meta tags and use them in function parameters to provide additional information to the Unreal Header Tool.\n\n#### Examples\n\n```cpp\nUCLASS()\nclass MyActor : public AActor\n{\n    GENERATED_BODY()\n\npublic:\n    // A function that takes a parameter passed by reference\n    UFUNCTION(BlueprintCallable, Category = \"MyActor\")\n    void ModifyValue(UPARAM(Ref) int32\u0026 ValueToModify)\n    {\n        // Modify the value passed by reference\n        ValueToModify *= 2;\n    }\n};\n```\n\nYou can read more about [UPARAM by BenUi](https://benui.ca/unreal/uparam/).\n\n### UMETA\n\n`UMETA` is a macro used to specify additional metadata for an UENUM entry. It allows adding custom information to enum values for use in Blueprint, UI, and other engine systems.\n\n#### Common Specifiers\n\n-   `DisplayName`: Sets a custom display name for the enumeration value in the editor.\n\n-   `ToolTip`: Provides a tooltip description for the enumeration value in the editor.\n\n-   `Hidden`: Hides the enumeration value from being displayed in the editor.\n\n-   `DisplayPriority`: Specifies the display priority for the enumeration value in the editor.\n\n-   `DisplayThumbnail`: Allows attaching a custom thumbnail image to the enumeration value in the editor.\n\n-   `CustomMetaData`: Specifies custom metadata that developers can define and use as needed.\n\n#### Examples\n\n```cpp\nUENUM(BlueprintType)\nenum class EMyEnum\n{\n    Value1 UMETA(DisplayName = \"First Value\", ToolTip = \"This is the first value\"),\n    Value2 UMETA(DisplayName = \"Second Value\", ToolTip = \"This is the second value\"),\n    Value3 UMETA(Hidden),\n};\n```\n\nYou can read more about [UMETA by BenUi](https://benui.ca/unreal/umeta/).\n\n\u003c!-- prettier-ignore-start --\u003e\n\n## 🧱 Data Types\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n![Data types](static/img/Data_types.png)\n\n### Characters\n\nIn C++ native, you write a character by using `char` data type:\n\n```cpp\nchar myChar = 'a';\n```\n\nIn Unreal, there are couples or `char` data types:\n\n* `ANSICHAR` - An ANSI character. Normally a signed type.\n* `WIDECHAR` - A wide character. Normally a signed type.\n* `TCHAR` - Either `ANSICHAR` or `WIDECHAR`, depending on whether the platform supports wide characters or the requirements of the licensee.\n* `UTF8CHAR` - An 8-bit character containing a UTF8 (Unicode, 8-bit, variable-width) code unit.\n* `UTF16CHAR` - An 16-bit character containing a UTF16 (Unicode, 16-bit, variable-width) code unit.\n* `UTF32CHAR` - An 32-bit character containing a UTF32 (Unicode, 32-bit, fixed-width) code unit.\n\nWhen working with Unreal, you are typical going to work with `TCHAR` data type as a `char` type.\n\nDefine `TCHAR`:\n\n```cpp\nTCHAR MyChar = 'A';\n```\n\nAnd to use the extra functions for these data types, you must use:\n\n* `FChar` for `TCHAR`\n* `FCharWide`  for `WIDECHAR`\n* `FCharAnsi` for `ANSICHAR`\n\nHere's a list of functions, you can access from `FChar`:\n\n* `ToUpper()` - Only converts ASCII characters.\n* `ToLower()` - Only converts ASCII characters.\n* `IsUpper()` - Returns a boolean if the character is an uppercase letter.\n* `IsLower()` - Returns a boolean if the character is a lowercase letter.\n* `IsAlpha()` - Returns a boolean if the character is an alphabetic letter.\n* `IsGraph()` - Returns a boolean if the character is a graphic character (printable and not a space).\n* `IsPrint()` - Returns a boolean if the character is a printable character (including whitespace).\n* `IsPunct()` - Returns a boolean if the character is a punctuation character (neither alphanumeric nor a whitespace).\n* `IsAlnum()` - Returns a boolean if the character is an alphanumeric character (a letter or a digit).\n* `IsDigit()` - Returns a boolean if the character is a hexadecimal digit (0-9, a-f or A-f).\n* `IsHexDigit()` - Returns a boolean if the character is a decimal digit (0-9).\n* `IsWhitespace()` - Returns a boolean if the character is a whitespace character (space, tab, newline, carriage return, vertical tab or form feed).\n* `IsControl()` - Returns a boolean if the character is a control character (non-printing).\n* `IsOctDigit()` - Returns a boolean if the character is an octal digit (0-7).\n* `ConvertCharDigitToInt()` - Converts a character representing a decimal digit to an integer.\n* `IsIdentifier()` - Returns a boolean if the character is an alphanumeric or underscore character.\n* `IsUnderscore()` - Returns a boolean if the character is an underscore.\n* `ToUnsigned()` - Convert a character to an unsigned integer to avoid sign extension problems with signed characters smaller than `int`.\n\nInclude the header file:\n\n```cpp\n#include \"Misc/Char.h\"\n```\n\nHere's an example, of using these functions from `FChar`:\n\n```cpp\nTCHAR MyChar = 'a';\n\nMyChar = FChar::ToUpper(MyChar); // MyChar: A\n\nbool bIsDigit = FChar::IsDigit(MyChar); // false\nbool bIsDigit = FChar::IsAlpha(MyChar); // true\n```\n\nYou can read more about [TCHAR on Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Misc/TChar/).\n\n### Booleans\n\n```cpp\n// Unreal uses a 'b' prefix for booleans (always in lowercase).\nbool bIsDead = true;\n```\n\n### Integers\n\nIn C++ native, you write a integer by using `int` data type:\n\n```cpp\nint health = 10;\n```\n\nIn Unreal, you write a integer by using `int32`:\n\n```cpp\nint32 Health = 10;\n```\n\nIn Unreal, the availability of different integer types such as `int8`, `int16`, and `int64` alongside the standard `int32` provides developers with a range of options tailored to specific needs in terms of both data size and numerical range.\n\n```cpp\nint8 NumberA = 0;       // -128                             -\u003e      127\nint16 NumberB = 0;      // -32,768                           -\u003e      32,767\nint32 NumberC = 0;      // -2,147,483,648                   -\u003e      2,147,483,647\nint64 NumberD = 0;      // 9,223,372,036,854,775,808        -\u003e      9,223,372,036,854,775,807\n```\n\nYou also have unsigned (positive-only) integers as well:\n\n```cpp\nuint8 NumberA = 0;      // 0    -\u003e      255\nuint16 NumberB = 0;     // 0    -\u003e      65,535\nuint32 NumberC = 0;     // 0    -\u003e      4,294,967,295\nuint64 NumberD = 0;     // 0    -\u003e      18,446,744,073,709,551,615\n```\n\n### Floating point numbers\n\n```cpp\n// C++ always uses 'f' or 'F' literal for defining a float variable.\nfloat SpeedInMetersPerSecond = 5.5f;\n```\n\n```cpp\n// C++ never uses a literal for defining a double variable.\ndouble SpeedInMetersPerSecond = 5.5;\n```\n\n### 🛟 Size can vary\n\nIt is generally recommended to use Unreal's typedefs, such as `int32` instead of `int` for representing 32-bit signed integers. This is because the exact size of `int` is not defined by the C++ standard.\n\nC++ implementation can define the size of a data type in bytes (`sizeof(type)`) to be any value, as long as:\n\n* The expression `sizeof(type) * CHAR_BIT` evaluates to a number of bits high enough to contain required ranges.\n* And the ordering of type is still valid (e.g. `sizeof(int) \u003c= sizeof(long)`).\n\nThe `CHAR_BIT` is the number of bits in char. It is declared in “limits.h” header file in C++ language. It is of 8-bits per byte.\n\nYou can read more about data ranges in this [section](#-data-types).\n\nSo, the summary data sizes would be:\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\n* `char`, `signed char` and `unsigned char` are at least 8 bits\n\n* `signed short`, `unsigned short`, `signed int` and `unsigned int` are at least 16 bits\n\n* `signed long` and `unsigned long` are at least 32 bits\n\n* `signed long long` and `unsigned long long` are at least 64 bits\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nYou can read more in-depth about this from [Alex on Stack Overflow](https://stackoverflow.com/a/589684/17067030).\n\n---\n\nHere's a full list of Unreal's data type sizes:\n\n| Data Type | Signed | Size (bytes) |\n| --------- | ------ | ------------ |\n| `bool`   | -  | NEVER assume the size |\n| `TCHAR`   | -  | NEVER assume the size |\n| `uint8`   | false  | 1            |\n| `int8`    | true   | 1            |\n| `uint16`  | false  | 2            |\n| `int16`   | true   | 2            |\n| `uint32`  | false  | 4            |\n| `int32`   | true   | 4            |\n| `uint64`  | false  | 8            |\n| `int64`   | true   | 8            |\n| `float`   | true   | 4            |\n| `double`  | true   | 8            |\n\n### 🦺 Unreal Engine Typedefs\n\nIn Unreal Engine, instead of writing `signed long long` for a 64-bit integer, you can now write `int64` instead. These aliases are called **typedefs**, which you can read more about [typedef keyword in C++ docs](https://en.cppreference.com/w/cpp/language/typedef).\n\nYou can read more about C++ typedefs in [this section](#typedefs).\n\nHere is a full list of Unreal Engine's typedefs:\n\n```cpp\n//~ Unsigned base types.\n/// An 8-bit unsigned integer.\ntypedef FPlatformTypes::uint8\t\tuint8;\n/// A 16-bit unsigned integer.\ntypedef FPlatformTypes::uint16\t\tuint16;\n/// A 32-bit unsigned integer.\ntypedef FPlatformTypes::uint32\t\tuint32;\n/// A 64-bit unsigned integer.\ntypedef FPlatformTypes::uint64\t\tuint64;\n\n//~ Signed base types.\n/// An 8-bit signed integer.\ntypedef\tFPlatformTypes::int8\t\tint8;\n/// A 16-bit signed integer.\ntypedef FPlatformTypes::int16\t\tint16;\n/// A 32-bit signed integer.\ntypedef FPlatformTypes::int32\t\tint32;\n/// A 64-bit signed integer.\ntypedef FPlatformTypes::int64\t\tint64;\n\n//~ Character types.\n/// An ANSI character. Normally a signed type.\ntypedef FPlatformTypes::ANSICHAR\tANSICHAR;\n/// A wide character. Normally a signed type.\ntypedef FPlatformTypes::WIDECHAR\tWIDECHAR;\n/// Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requirements of the licensee.\ntypedef FPlatformTypes::TCHAR\t\tTCHAR;\n/// An 8-bit character containing a UTF8 (Unicode, 8-bit, variable-width) code unit.\ntypedef FPlatformTypes::UTF8CHAR\tUTF8CHAR;\n/// A 16-bit character containing a UCS2 (Unicode, 16-bit, fixed-width) code unit, used for compatibility with 'Windows TCHAR' across multiple platforms.\ntypedef FPlatformTypes::CHAR16\t\tUCS2CHAR;\n/// A 16-bit character containing a UTF16 (Unicode, 16-bit, variable-width) code unit.\ntypedef FPlatformTypes::CHAR16\t\tUTF16CHAR;\n/// A 32-bit character containing a UTF32 (Unicode, 32-bit, fixed-width) code unit.\ntypedef FPlatformTypes::CHAR32\t\tUTF32CHAR;\n\n/// An unsigned integer the same size as a pointer\ntypedef FPlatformTypes::UPTRINT UPTRINT;\n/// A signed integer the same size as a pointer\ntypedef FPlatformTypes::PTRINT PTRINT;\n/// An unsigned integer the same size as a pointer, the same as UPTRINT\ntypedef FPlatformTypes::SIZE_T SIZE_T;\n/// An integer the same size as a pointer, the same as PTRINT\ntypedef FPlatformTypes::SSIZE_T SSIZE_T;\n\n/// The type of the NULL constant.\ntypedef FPlatformTypes::TYPE_OF_NULL\tTYPE_OF_NULL;\n/// The type of the C++ nullptr keyword.\ntypedef FPlatformTypes::TYPE_OF_NULLPTR\tTYPE_OF_NULLPTR;\n```\n\n\u003e [!WARNING]\n\u003e `uint16`, `uint32`, `uint64`, `int8`, `int16` and `double` are not supported with UHT[^2]. Meaning, can't expose to Blueprint.\n\n### 📖 String Data Types\n\nString in programming languages are fundamental data types used to represent and manipulate sequences of characters, such as words, sentences, or even binary data. They are extensively used in various programming tasks, including input/output operations, text processing, data serialization, and more.\n\nIn Unreal Engine, strings play a crucial role in handling text-based information within the game or application. Unreal Engine provides several string-related classes to cater to different use cases and requirements.\n\nYou can read more about [string handling from the docs](https://docs.unrealengine.com/4.26/en-US/ProgrammingAndScripting/ProgrammingWithCPP/UnrealArchitecture/StringHandling/).\n\n### Text Macros\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\n* `TEXT` - This macro is used for specifying wide-character (UTF-16) encoding. This makes the string literal platform independent. Without this macro, you are using ANSI encoding (which can cause issues on other machines).\n\n* `INVTEXT` - This macro is calling FText::AsCultureInvariant(TEXT(InTextLiteral)) with InTextLiteral as parameter. Helpful creating culture invariant FText from the given string literal.\n\n* `LOCTEXT` - This macro is used to create `FText` literals specifically for localization. It takes a namespace and a key to identify the localized string.\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n#### FName\n\nIn Unreal Engine, `FName` is a specialized type used for identifying objects within the Unreal Engine object system. It is optimized for fast comparison and storage and is commonly used for referencing actors, components, or assets in a performance-efficient manner.\n\nThe `FName` class stores strings as hashed indices, making it a lightweight and fast alternative to regular strings. Because of this, `FName` are **immutable** string class.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"UObject/NameTypes.h\"\n```\n\nDeclare `FName`:\n\n```cpp\nFName MyName = FName(TEXT(\"PlayerName\"));\n```\n\n#### FText\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n`FText` is a specialized string class designed for localization support in Unreal Engine. Because of this, `FText` are **immutable** string class. FText provides the ability to represent text in different languages and cultures, making it a crucial component for building multi-language games or applications.\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/ftext-in-unreal-engine/).\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Internationalization/Text.h\"\n```\n\nDeclare `FText` from a string literal (non-localized):\n\n```cpp\n// Avoid this! Since this cost more performance than initializing directly as FText.\nFText NewGameText = FText::FromString(TEXT(\"New Game\"));\n```\n\nTo use a multi-line `FText` inside Unreal Editor, you can specify `UPROPERTY` with meta tag of `Multiline`:\n\n```cpp\nUPROPERTY(EditAnywhere, Category = \"Details\", meta = (MultiLine = \"true\"))\nFText Description;\n```\n\nDeclare `FText` from `INVTEXT()` macro. Which creates a culture invariant `FText` from a string literal:\n\n```cpp\nFText TooltipText = INVTEXT(\"Tooltip Text\");\n\n/*\n    Inside Unreal Engine source code:\n\n    // Creates a culture invariant FText from the given string literal.\n    #define INVTEXT(InTextLiteral) FText::AsCultureInvariant(TEXT(InTextLiteral))\n*/\n\n// So, FText::AsCultureInvariant does the same thing as INVTEXT() macro.\nFText NewTooltipText = FText::AsCultureInvariant(TEXT(\"This is another tooltip text\"));\n```\n\n```cpp\n// Define the namespace to use with LOCTEXT\n// This is only valid within a single file, and must be undefined before the end of the file\n#define LOCTEXT_NAMESPACE \"MyNamespace\"\n// Create text literals\nFText PlayGameText = LOCTEXT(\"PlayGame\", \"Spiel beginnen\"); // German langauge\n\n// Helpful in the editor to localize the text into another language.\nFText QuitGameText = NSLOCTEXT(\"StartMenu\", \"QuitGame\", \"Avsluta spelet\"); // Swedish language\n\nuint32 VersionNumber = 1405476850;\nFText MachineOS = INVTEXT(\"Windows 11 Pro, 22H2, 22621.2215\");\nFText UserName = INVTEXT(\"MrRobin\");\nint32 UserAge = 22;\nint32 SpeedInKph = 30;\nint32 FuelInPercentage = 80;\n\n// Formatting with FText. The supported types is: int32, uint32, float, double, FText, ETextGender.\nFText VersionMessageText = FText::Format(\n    LOCTEXT(\"VersionMessage\", \"You current version is {0} and is running on {1}\"),\n    VersionNumber,\n    MachineOS\n);\n\n// FString also has FString::Prinf() function for formatting. FString::Prinf() is also similar to the native C++ sprintf() function.\n\n// Use FFormatNamedArguments for organizing the FText::Format function.\nFFormatNamedArguments Args;\nArgs.Add(TEXT(\"Name\"), UserName);\nArgs.Add(TEXT(\"Age\"), UserAge);\nFText UserText = FText::Format(LOCTEXT(\"UserData\", \"User's name is {UserName} and is {Age} years old.\"), Args);\n\n// You can also use FText::FormatNamed() function for formatting as well. Great for inlining the code.\nFText CarMessageText = FText::FormatNamed(\n    LOCTEXT(\"VehicleMessage\", \"You current speed is {Speed} and the fuel is at {Fuel}%\"),\n    TEXT(\"Speed\"), SpeedInKph,\n    TEXT(\"Fuel\"), FuelInPercentage\n);\n\n#undef LOCTEXT_NAMESPACE // Undefine the current namespace\n```\n\nYou can convert specific data type into `FText` format. For an example, can you use `FText::AsNumber()` to convert a number into `FText` with specific `FNumberFormattingOptions` formatting options.\n\nHere's an example:\n\n```cpp\nfloat Health = 99.8999f; // We want to round this up, like this: 100.00\n\nbool bIncludeLeadingZero = true;\nint32 Precision = 2; // Number of decimals after decimal point. (0.00)\n\nFNumberFormattingOptions NumberFormat;\nNumberFormat.MinimumIntegralDigits = (bIncludeLeadingZero) ? 1 : 0;\nNumberFormat.MaximumIntegralDigits = 10000;\nNumberFormat.MinimumFractionalDigits = Precision;\nNumberFormat.MaximumFractionalDigits = Precision;\n\nFText NumberText = FText::AsNumber(Health, \u0026NumberFormat);\nNumberText = FText::AsCultureInvariant(NumberText); // Disable the culture formatting\n```\n\n\u003e [!NOTE]\n\u003e By default, Unreal will use local culture when doing this format. If you wish to disable culture formatting, use `FText::AsCultureInvariant` function.\n\n#### FString\n\n`FString` is a dynamic, **mutable** string type in Unreal Engine, which provides a more flexible approach to string manipulation. Unlike `FName`, `FString` allows for modifications, such as appending, inserting, or removing characters, making it suitable for general string operations. It is widely used for various tasks, such as displaying messages, concatenating text, or formatting output strings.\n\nExample usage:\n\n```cpp\n#include \"Containers/UnrealString.h\"\n\nFString MyString = FString(\"Hello, World!\");\n```\n\nReplace a substring with another in a `FString`:\n\n```cpp\nFString OriginalString = FString(\"Hello, my friend.\");\nOriginalString.ReplaceInline(TEXT(\"friend\"), TEXT(\"buddy\")); // Output: \"Hello, my buddy.\"\n```\n\nSplit a `FString` into an array of substrings using a delimiter:\n\n```cpp\nFString Sentence = FString(\"This is a sentence.\");\nTArray\u003cFString\u003e Words;\nSentence.ParseIntoArray(Words, TEXT(\" \"), true); // Output: [\"This\", \"is\", \"a\", \"sentence.\"]\n```\n\nReverse a `FString`:\n\n```cpp\nFString Text = FString(\"abcde\");\nText.ReverseString(); // Output: \"edcba\"\n```\n\n---\n\n| Data Type | Description | Use Case |\n|-----------|-------------|----------|\n| `FName` | A fast and lightweight name identifier for objects in Unreal Engine. | Best used for identifying assets and objects within the engine to save memory and improve performance. |\n| `FText` | A localized string that supports text localization and provides text display features. | Ideal for displaying text to users in the game, supporting multiple languages and localization. |\n| `FString` | A dynamic string that can be modified and used for general-purpose string manipulation. | Suitable for general text handling and string operations within the game code. |\n\n### 🚀 Math Data Types\n\n\u003e [!NOTE]\n\u003e In Unreal Engine 5.0+, by default, all math related data types are using `double` as backend data type. This allows Unreal to support [large world coordinates (LWC)](https://docs.unrealengine.com/5.3/en-US/large-world-coordinates-in-unreal-engine-5/).\n\n#### Vector4\n\nA struct representing a 4D vector, consisting of four float values for the `X`, `Y`, `Z`, and `W` components.\n\nDeclare and initialize a `FVector4`:\n\n```cpp\nFVector4 MyVector = FVector(1.0f, 2.0f, 3.0f, 4.0f);\n```\n\nYou can also initalize by an pre-made vector:\n\n```cpp\nFVector4 OldLocation = FVector4::ZeroVector; // (0, 0, 0)\nFVector4 NewLocation = FVector4::OneVector; // (1, 1, 1)\n```\n\n\u003e [!NOTE]\n\u003e Use `FVector4f` for `float` and `FVector4d` for `double`, as explicit data type for the backend conversion.\n\n---\n\nTo use the integer version of `FVector4`:\n\n```cpp\nFIntVector4 IntVector4; // Default to 32-bit\nFInt32Vector4 Int32Vector4; // 32-bit\nFInt64Vector4 Int64Vector4; // 64-bit\n\nFUintVector4 UintVector4; // Default to unsigned 32-bit\nFUint32Vector4 Uint32Vector4; // Unsigned 32-bit\nFUint64Vector4 FUint64Vector4; // Unsigned 64-bit\n```\n\n#### Vector3\n\nA struct representing a 3D vector, consisting of three float values for the `X`, `Y`, and `Z` components. It is often used to represent position or direction in 3D space, and provides many useful functions such as vector addition, subtraction, normalization, and dot and cross products.\n\nDeclare and initialize a `FVector`:\n\n```cpp\nFVector MyVector = FVector(1.0f, 2.0f, 3.0f);\n```\n\nYou can also initalize by an pre-made vector:\n\n```cpp\nFVector OldLocation = FVector::ZeroVector; // (0, 0, 0)\nFVector NewLocation = FVector::OneVector; // (1, 1, 1)\n```\n\nYou can select each component separately:\n\n```cpp\nFVector Vec = FVector::OneVector;\n\ndouble X = Vec.X;\ndouble Y = Vec.Y;\ndouble Z = Vec.Z;\n\n// or\n\ndouble\u0026 X = Vec[0];\ndouble\u0026 Y = Vec[1];\ndouble\u0026 Z = Vec[2];\n```\n\n\u003e [!NOTE]\n\u003e Use `FVector3f` for `float` and `FVector3d` for `double`, as explicit data type for the backend conversion.\n\n---\n\nCommon static functions to use:\n\n* `FVector::Cross()` - Calculate cross product this and another vector.\n* `FVector::CrossProduct()` - Calculate the cross product of two vectors.\n* `FVector::Dot()` - Calculate the dot product between this and another vector.\n* `FVector::DotProduct()` - Calculate the dot product of two vectors.\n* `FVector::Dist()` or `FVector::Distance()` - Euclidean distance between two points.\n* `FVector::Dist2D()` or `FVector::DistXY()` - Euclidean distance between two points in the XY plane (ignoring Z).\n* `FVector::DistSquared()` - Squared distance between two points.\n* `FVector::DistSquared2D()` or `FVector::DistSquaredXY()` - Squared distance between two points in the XY plane only.\n* `FVector::AllComponentsEqual()` - Check whether all components of this vector are the same, within a tolerance.\n\n\u003e [!TIP]\n\u003e You can use `|` operator for calling the dot product.\n\n\u003e [!TIP]\n\u003e You can use `^` operator for calling the cross product.\n\nCommon local functions to use:\n\n* `GetComponentForAxis()` - Get a specific component of the vector, given a specific axis by enum.\n* `SetGetComponentForAxis()` - Set a specified component of the vector, given a specific axis by enum.\n* `Set()` - Set the values of the vector directly.\n* `GetMax()` - Get the maximum value of the vector's components.\n* `GetAbsMax()` - Get the maximum absolute value of the vector's components.\n* `GetMin()` - Get the minimum absolute value of the vector's components.\n* `GetAbsMin()` - Get the minimum absolute value of the vector's components.\n* `GetAbs()` - Get a copy of this vector with absolute value of each component.\n* `Size()` or `Length()` - Get the length (magnitude) of this vector.\n* `SizeSquared()` or `SquaredLength()` - Get the squared length of this vector.\n* `Size2D()` - Get the length of the 2D components of this vector.\n* `SizeSquared2D()` - Get the squared length of the 2D components of this vector.\n* `HeadingAngle()` - Convert a direction vector into a 'heading' angle.\n* `IsNearlyZero()` - Check whether vector is near to zero within a specified tolerance.\n* `IsZero()` - Check whether all components of the vector are exactly zero.\n* `IsUnit()` - Check if the vector is of unit length, with specified tolerance.\n* `IsNormalized()` - Checks whether vector is normalized.\n* `Normalize()` - Normalize this vector in-place if it is larger than a given tolerance. Leaves it unchanged, if not.\n* `GetSignVector()` - Get a copy of the vector as sign only. Each component is set to +1 or -1, with the sign of zero treated as +1.\n* `Projection()` - Projects 2D components of vector based Z.\n* `GridSnap()` - Get a copy of this vector snapped to a grid.\n* `IsUniform()` - Check whether X, Y and Z are nearly equal.\n* `ConstainsNaN()` - Utility to check if there are any non-finite values (NaN or Inf) in this vector.\n* `ToString()` - Get a textural representation of this vector.\n* `ToCompactString()` - Get a short textural representation of this vector, for compact, readable logging.\n* `ToText()` - Get a locale aware textural representation of this vector.\n* `ToCompactText()` - Get a short locale aware textural representation of this vector, for compact, readable logging.\n\n---\n\nTo use the integer version of `FVector`:\n\n```cpp\nFIntVector IntVector = FIntVector(5, 10, -25); // Default to 32-bit\nFUintVector UintVector = FUintVector(5, 10, 25); // Default to unsigned 32-bit\n```\n\nHere's the more explicit versions:\n\n```cpp\nFIntVector3 IntVector3; // Default to 32-bit\nFInt32Vector3 Int32Vector3; // 32-bit\nFInt64Vector3 Int64Vector3; // 64-bit\n\nFUintVector3 UintVector3; // Default to unsigned 32-bit\nFUint32Vector3 Uint32Vector3; // Unsigned 32-bit\nFUint64Vector3 FUint64Vector3; // Unsigned 64-bit\n```\n\n#### Vector2\n\nA struct representing a 2D vector, consisting of two float values for the `X` and `Y` components.\n\nDeclare and initialize a `FVector2D`:\n\n```cpp\nFVector2D MyVector = FVector2D(1.0f, 2.0f, 3.0f);\n```\n\nYou can also initalize by an pre-made vector:\n\n```cpp\nFVector2D OldLocation = FVector2D::ZeroVector; // (0, 0, 0)\nFVector2D NewLocation = FVector2D::OneVector; // (1, 1, 1)\n```\n\n\u003e [!NOTE]\n\u003e Use `FVector2f` for `float` and `FVector2d` for `double`, as explicit data type for the backend conversion.\n\n---\n\nTo use the integer version of `FVector2D`:\n\n```cpp\nFIntVector2 IntVector2; // Default to 32-bit\nFInt32Vector2 Int32Vector2; // 32-bit\nFInt64Vector2 Int64Vector2; // 64-bit\n\nFUintVector2 UintVector2; // Default to unsigned 32-bit\nFUint32Vector2 Uint32Vector2; // Unsigned 32-bit\nFUint64Vector2 FUint64Vector2; // Unsigned 64-bit\n```\n\n#### IntPoint\n\nA struct representing a 2D integer points, consisting of two int values for the `X` and `Y` components.\n\nDeclare and initialize a `FIntPoint`:\n\n```cpp\nFIntPoint MinPoint = FIntPoint(-127, -127);\nFIntPoint MaxPoint = FIntPoint(128, 128);\n```\n\nDeclare and initialize a `FUIntPoint`:\n\n```cpp\nFUIntPoint UnsignedMinPoint = FUIntPoint(0, 0);\nFUIntPoint UnsignedMaxPoint = FUIntPoint(255, 255);\n```\n\n\u003e [!NOTE]\n\u003e Use `FInt32Point` for `int32`, `FUint32Point` for `uint32`, `FInt64Point` for `int64` and `FUint64Point` for `uint64`, as explicit data type for the backend conversion.\n\n#### IntRect\n\nA struct representing a 2D integer rectangles, consisting of two IntPoint values for the `Min` and `Max` components.\n\nDeclare and initialize a `FIntRect`:\n\n```cpp\nFIntPoint MinPoint = FIntPoint(-127, -127);\nFIntPoint MaxPoint = FIntPoint(128, 128);\nFIntReact Rect = FIntRect(MinPoint, MaxPoint);\n```\n\nDeclare and initialize a `FUIntReact`:\n\n```cpp\nFUIntPoint UnsignedMinPoint = FUIntPoint(0, 0);\nFUIntPoint UnsignedMaxPoint = FUIntPoint(255, 255);\nFUIntReact UnsignedRect = FIntRect(UnsignedMinPoint, UnsignedMaxPoint);\n```\n\n\u003e [!NOTE]\n\u003e Use `FInt32Rect` for `int32`, `FUint32Rect` for `uint32`, `FInt64Rect` for `int64` and `FUint64Rect` for `uint64`, as explicit data type for the backend conversion.\n\n#### Rotator\n\nA struct representing a rotation in 3D space, consisting of three float values for the `Pitch`, `Yaw`, and `Roll` angles. It is often used to represent the orientation of an object, and provides many useful functions such as conversion to and from quaternions, and rotation of other vectors and rotators.\n\nDeclare and initialize a `FRotator`:\n\n```cpp\nFRotator MyRotator = FRotator(0.0f, 90.0f, 0.0f);\n```\n\nYou can also initalize by an pre-made rotator:\n\n```cpp\nFRotator MyRotator = FRotator::ZeroRotator; // (0, 0, 0)\n```\n\n\u003e [!NOTE]\n\u003e Use `FRotator3f` for `float` and `FRotator3d` for `double`, as explicit data type for the backend conversion.\n\n---\n\nCommon static functions to use:\n\n* `FRotator::Vector()` - Convert a rotation into a unit vector facing in its direction.\n\nCommon local functions to use:\n\n* `GetInverse()` - Returns the inverse of the rotator.\n* `GridSnap()` - Get the rotation, snapped to specified degree segments.\n\n#### Quaternion\n\nA struct representing a quaternion in 3D space, consisting of three float values for the `X`, `Y`, `Z`, and `W` components. Quaternion a mathematical concept used to represent 3D rotations. It is commonly used in conjunction with `FVector` to represent orientations and rotations in 3D space.\n\nDeclare and initialize a `FQuat`:\n\n```cpp\nFQuat MyQuaternion = FQuat(0.0f, 90.0f, 0.0f, 0.0f);\n```\n\nYou can also initalize by an pre-made quaternion:\n\n```cpp\nFQuat MyQuaternion = FQuat::Identify; // (0, 0, 0, 0)\n```\n\n\u003e [!NOTE]\n\u003e Use `FQuat4f` for `float` and `FQuat4d` for `double`, as explicit data type for the backend conversion.\n\n#### Transform\n\nA struct representing a 3D transformation, consisting of a `FVector` for translation, a `FQuat` for rotation, and a `FVector` for scale. It is often used to represent the position, orientation, and size of an object in 3D space, and provides many useful functions for transforming other vectors and transforms.\n\nDeclare and initialize a `FTransform`:\n\n```cpp\nFVector Location = FVector::ZeroVector;\nFRotator Rotation = FRotator::ZeroRotator;\nFVector Scale = FVector::OneVector;\n\n// Note! Unreal will convert FRotator into FQuat in the backend.\nFTransform MyTransform = FTransform(Rotation, Location, Scale);\n```\n\nYou can also initalize by an pre-made transform:\n\n```cpp\nFTransform MyTransform = FTransform::Identify; // NaN\n```\n\n\u003e [!NOTE]\n\u003e Use `FTransform3f` for `float` and `FTransform3d` for `double`, as explicit data type for the backend conversion.\n\n#### Plane\n\nA struct representing a 3D plane.\n\nHere's an example:\n\n```cpp\nfloat X = 0.0f;\nfloat Y = 0.0f;\nfloat X = 0.0f;\n\nFPlane Plane = FVector(X, Y, Z);\n```\n\nHere's another way to initialize `FPlane`:\n\n```cpp\nFPlane Plane = FVector(FVector(0.0f, 0.0f, 0.0f));\n```\n\n\u003e [!NOTE]\n\u003e Use `FPlane4f` for `float` and `FPlane4d` for `double`, as explicit data type for the backend conversion.\n\n#### Matrix\n\nA struct representing a 4x4 matrix of loating point values.\n\nHere's an example:\n\n```cpp\nFPlane XPlane = FPlane(1.0f, 0.0f, 0.0f, 0.0f);\nFPlane YPlane = FPlane(0.0f, 1.0f, 0.0f, 0.0f);\nFPlane ZPlane = FPlane(0.0f, 0.0f, 1.0f, 0.0f);\nFPlane WPlane = FPlane(0.0f, 0.0f, 0.0f, 1.0f);\n\nFMatrix Matrix = FMatrix(XPlane, YPlane, ZPlane, WPlane);\n```\n\n```cpp\nFVector XVector = FVector(1.0f, 0.0f, 0.0f);\nFVector YVector = FVector(0.0f, 1.0f, 0.0f);\nFVector ZVector = FVector(0.0f, 0.0f, 1.0f);\nFVector WVector = FVector(0.0f, 0.0f, 0.0f);\n\nFMatrix Matrix = FMatrix(XVector, YVector, ZVector, WVector);\n```\n\n```cpp\nFMatrix Matrix;\n\nint32 RowIndex = 0;\nint32 ColumnIndex = 0;\n\ndouble Element = Matrix[RowIndex][ColumnIndex];\n```\n\n\u003e [!NOTE]\n\u003e Use `FMatrix44f` for `float` and `FMatrix44d` for `double`, as explicit data type for the backend conversion.\n\n#### Sphere\n\nA struct representing a 3D sphere.\n\nHere's an example:\n\n```cpp\nFVector Center = FVector::ZeroVector;\nfloat Radius = 500.0f;\n\nFSphere Sphere = FSphere(Center, Radius);\n```\n\n\u003e [!NOTE]\n\u003e Use `FSphere3f` for `float` and `FSphere3d` for `double`, as explicit data type for the backend conversion.\n\n#### Box\n\nA struct representing a 3D box.\n\nHere's an example:\n\n```cpp\nFVector MinPoint = FVector(15.5f, 15.5f);\nFVector MaxPoint = FVector(25.0f, 25.0f);\n\nFBox Box2D = FBox(MinPoint, MaxPoint);\n```\n\n\u003e [!NOTE]\n\u003e Use `FBox3f` for `float` and `FBox3d` for `double`, as explicit data type for the backend conversion.\n\n#### Box2D\n\nA struct representing a 2D box.\n\nHere's an example:\n\n```cpp\nFVector2D MinPoint = FVector2D(10, 10);\nFVector2D MaxPoint = FVector2D(20, 20);\n\nFBox2D Box2D = FBox2D(MinPoint, MaxPoint);\n```\n\n\u003e [!NOTE]\n\u003e Use `FBox2f` for `float` and `FBox2d` for `double`, as explicit data type for the backend conversion.\n\n#### Ray\n\nA struct representing a 3D ray, consisting of two vector values for the `Origin` and `Direction` components.\n\nHere's an example:\n\n```cpp\nFVector Origin = FVector::ZeroVector;\nFVector Direction = FVector::ForwardVector;\nbool bDirectionIsNormalized = false;\n\nFRay Ray = FRay(Origin, Direction, bDirectionIsNormalized);\n```\n\nFunctions to use with `FRay`:\n\n```cpp\nFVector Point = FVector::ZeroVector;\n\nFVector ClosestPoint = Ray.ClosestPoint(Point);\ndouble MinDistance = Ray.Dist(Point);\ndouble MinSqrtDistance = Ray.DistSquared(Point);\n\ndouble ScalarDistance = 0.5; // Along the ray\nFVector PointAt = Ray.PointAt(ScalarDistance);\ndouble CalcScalarDistance = Ray.GetParameter(PointAt); // Will convert back to 'ScalarDistance'\n```\n\n\u003e [!NOTE]\n\u003e Use `FRay3f` for `float` and `FRay3d` for `double`, as explicit data type for the backend conversion.\n\n#### Colors\n\n`FColor` stores a color with 8 bits (byte) of precision per channel.\n\n`FLinearColor` stores a linear color with 32-bit/component floating point RGBA color.\n\nHere's an example, how to initialize them:\n\n```cpp\nFLinearColor LinearColor = FLinearColor(0.5f, 1.0f, 0.3f);\n```\n\n```cpp\nFColor Color = FColor(150, 200, 50);\n\n// or\n\n// Supported formats are: RGB, RRGGBB, RRGGBBAA, RGB, #RRGGBB, #RRGGBBAA\nFColor HexColor = FColor::FromHex(TEXT(\"#9fd99e\"));\nFString HexString = HexColor.ToHex(); // Convert it back to a string. The format of the string is RRGGBBAA.\n```\n\nList of common colors of `FLinearColor`:\n\n* `FLinearColor::White`\n* `FLinearColor::Gray`\n* `FLinearColor::Black`\n* `FLinearColor::Transparent`\n* `FLinearColor::Red`\n* `FLinearColor::Green`\n* `FLinearColor::Blue`\n* `FLinearColor::Yellow`\n\nList of common colors of `FColor`:\n\n* `FColor::White`\n* `FColor::Black`\n* `FColor::Transparent`\n* `FColor::Red`\n* `FColor::Green`\n* `FColor::Blue`\n* `FColor::Yellow`\n* `FColor::Cyan`\n* `FColor::Magenta`\n* `FColor::Orange`\n* `FColor::Purple`\n* `FColor::Turquoise`\n* `FColor::Silver`\n* `FColor::Emerald`\n\nYou can read more about [linear color at Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Math/FLinearColor/).\n\nYou can also read more about [color at Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Math/FColor/).\n\n### 💐 Collections\n\n![Collections](static/img/Collections.png)\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n| Data Container | Description                                                                                                                                                                                                                                                     | Use Case                                                                                                                                                                                   |\n|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **TArray**         | A dynamic array that can grow or shrink in size at runtime, supporting random access and iteration.                                                                                                                                                            | Suitable for storing and managing a collection of elements where the size may change frequently and quick access to elements is required.                                                  |\n| **TSet**           | A set data structure that stores unique elements in no particular order, efficiently supporting element insertion, deletion, and membership checks.                                                                                                              | Ideal for maintaining a collection of distinct elements and performing fast membership checks without duplicates.                                                                          |\n| **TMap**           | An associative container that stores key-value pairs, allowing efficient lookup and retrieval based on keys.                                                                                                                                                  | Used for creating dictionaries or associative arrays, where data is organized based on unique keys for quick and efficient access.                                                          |\n\n#### TArray\n\nA dynamic array that can store a variable number of elements of the same type. It provides many useful functions, such as adding, removing, sorting, and searching for elements, as well as iterating over them.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/Array.h\"\n```\n\nDeclare a `TArray` of `int32` (integers)\n\n```cpp\nTArray\u003cint32\u003e MyArray { 1, 2, 3 };\n```\n\nAdd an element to the array:\n\n```cpp\nMyArray.Add(4);\n\n// MyArray: { 1, 2, 3, 4 }\n```\n\nAdd multiple elements to the array:\n\n```cpp\nMyArray.Append({10, 15, 20});\n\n// MyArray: { 1, 2, 3, 4, 10, 15, 20 }\n```\n\nRemove elements from the array:\n\n```cpp\nMyArray.RemoveAt(0);\nMyArray.RemoveAt(0);\n\n// MyArray: { 3, 4, 10, 15, 20 }\n```\n\nGet the number of elements from the array:\n\n```cpp\nint32 NumOfElements = MyArray.Num(); // 5\n```\n\nLoop through the array and log each element:\n\n```cpp\nfor (const int32\u0026 Element : MyArray)\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Element: %i\"), Element);\n}\n```\n\n---\n\nYou can either allocate an array on the **stack** or on the **heap**. Without specifying, you are creating the array allocation on the heap, while the array returns a data container on the stack.\n\nIf you don't know about what the difference between **stack** and **heap** allocation, highly suggest reading upon the subject in [this section](#-stack-vs-heap).\n\nHere is a way to allocate an array on the stack:\n\n```cpp\nTArray\u003cint32, TInlineAllocator\u003c4\u003e\u003e StackArray; // Allocate 4 elements on the stack\n\nStackArray.Add(1);\nStackArray.Add(2);\nStackArray.Add(3);\nStackArray.Add(4);\n\n// Now we added the same amount of elements, to our buffer size (which has been allocated on the stack).\n// If we try to add more elements than allocated, Unreal will default TArray to use heap allocation for the rest of elements.\n\nStackArray.Add(5); // Will be allocated on the heap!\n```\n\n\u003e [!WARNING]\n\u003e If you're trying to allocate a heap object on the stack with `TInlineAllocator`, Unreal will default to a heap allocation.\n\n\u003e [!WARNING]\n\u003e If you add more elements than have been allocated for, Unreal will default to a heap allocation instead.\n\n\u003e [!NOTE]\n\u003e Unreal will treat as stack allocated array as a different data type, compare to a regular array. To accommodate this, use `TArrayView` instead.\n\nIf you want to avoid filling up the rest of elements with heap allocation, then use `TFixedAllocator`:\n\n```cpp\nTArray\u003cint32, TFixedAllocator\u003c4\u003e\u003e StackArray; // Allocate 4 elements on the stack\n\nStackArray.Add(1);\nStackArray.Add(2);\nStackArray.Add(3);\nStackArray.Add(4);\n\nStackArray.Add(5); // Unreal calls an assertion, which will CRASH Unreal in runtime mode!\n\n// If you're continuing on with the assertion, using Visual Studio Debugger, Unreal will call Reset() function.\n// Clearing out all elements, but keeping the current allocation size.\n\n// Same thing happens with brace initialization.\nTArray\u003cint32, TFixedAllocator\u003c4\u003e\u003e StackArray{ 1, 2, 3, 4, 5 }; // Allocate 4 elements on the stack, but we got 5 elements!\n```\n\n#### TSet\n\nA set of unique elements of a single type, implemented as a hash table. It provides many of the same functions as `TArray`, but with faster lookup times for large collections of elements.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/Set.h\"\n```\n\nDeclare a `TSet` of `FName` (names):\n\n```cpp\nTSet\u003cFName\u003e MySet;\n```\n\nAdd elements to the set:\n\n```cpp\n// Add single element to the set\nMySet.Add(TEXT(\"hello\"));\n\n// Add multiple elements to the set\nMySet.Append({TEXT(\"cruel\"), TEXT(\"world\"), TEXT(\"hello\")});\n\n// MySet: { \"hello\", \"cruel\", \"world\" }\n```\n\nGet number of elements from the set:\n\n```cpp\nint32 NumOfElements = MySet.Num(); // 4\n```\n\nCheck if an element exists in the set:\n\n```cpp\nif (MySet.Contains(TEXT(\"cruel\")))\n{\n    UE_LOG(LogTemp, Log, TEXT(\"'Cruel' element is in the set\"));\n}\n```\n\nRemove an element from the set:\n\n```cpp\nMySet.Remove(TEXT(\"cruel\"));\n\n// MySet: { \"hello\", \"world\" }\n```\n\nIterate through the set and log each element:\n\n```cpp\nfor (const FName\u0026 Name : MySet)\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Name: %s\"), *Name.ToString());\n}\n```\n\nConvert the set to an array:\n\n```cpp\nTArray\u003cFName\u003e CopyOfSet = MySet.Array();\nCopyOfSet[0] = TEXT(\"goodbye\");\n\n// CopyOfSet: { \"goodbye\", \"world\" }\n```\n\n#### TMap\n\nA map of key-value pairs, implemented as a hash table. It allows fast lookup of a value given a key, and supports adding, removing, and iterating over key-value pairs.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/Map.h\"\n```\n\nDeclare a `TMap` of `FName` (names) to `int32` (integers):\n\n```cpp\nTMap\u003cFName, int32\u003e MyMap = { { TEXT(\"player_id\"), 457865 }, { TEXT(\"player_age\"), 35 } };\n\n// MyMap: { { \"player_id\", 457865 }, { \"player_age\", 35 } }\n```\n\nAdd elements to the map:\n\n```cpp\nint32\u0026 PlayerRankRef = MyMap.Add(TEXT(\"player_rank\"));\nPlayerRankRef = 420;\n\nMyMap.Add(TEXT(\"player_speed\"), 15);\n\n// MyMap: { { \"player_id\", 457865 }, { \"player_age\", 35 }, { \"player_rank\", 420 }, { \"player_speed\", 15 } }\n```\n\nFinds the value in the map from the key. Otherwise, create and add the key to the map (with default value):\n\n```cpp\nint32\u0026 PlayerIDRef = MyMap.FindOrAdd(TEXT(\"player_id\"));\nPlayerIDRef = 001100;\n\n// MyMap: { { \"player_id\", 001100 }, { \"player_age\", 35 }, { \"player_rank\", 420 }, { \"player_speed\", 15 } }\n```\n\nGet number of elements from the map:\n\n```cpp\nint32 NumOfElements = MyMap.Num(); // 4\n```\n\nIterate through the map and log key-value pairs:\n\n```cpp\nfor (const TPair\u003cFName, int32\u003e\u0026 KeyValuePair : MyMap)\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Key: %s, Value: %i\"), *KeyValuePair.Key.ToString(), KeyValuePair.Value);\n}\n```\n\nCheck if \"player_rank\" exists in the map and log its value if found:\n\n```cpp\nif (int32* PlayerRankPtr = MyMap.Find(TEXT(\"player_rank\")))\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Player rank is: %i\"), *PlayerRankPtr);\n}\n```\n\nAccess an element in the map:\n\n```cpp\nint32 OutSpeed;\n\nif (MyMap.TryGetValue(TEXT(\"player_speed\"), OutSpeed))\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Player's speed: %i [m/s]\"), OutSpeed);\n}\n```\n\nModify an element in the map:\n\n```cpp\nMyMap[TEXT(\"player_age\")] = -1;\n\n// MyMap: { { \"player_id\", 001100 }, { \"player_age\", -1 }, { \"player_rank\", 420 }, { \"player_speed\", 15 } }\n```\n\nRemove an element from the map:\n\n```cpp\nMyMap.Remove(TEXT(\"player_age\")); // Reference variables (such as PlayerRankRef and PlayerIDRef) become unsafe since the map size and elements have changed.\n\n// MyMap: { { \"player_id\", 001100 }, { \"player_rank\", 420 }, { \"player_speed\", 15 } }\n```\n\nConvert the map to an array of key-value pairs:\n\n```cpp\nTArray\u003cTPair\u003cFName, int32\u003e\u003e KeyValueArray = MyMap.Array();\nint32 PlayerID = KeyValueArray[0].Value; // 001100\n```\n\n#### Common and helpful functions\n\nWith these containers, you can use a couple of helpful functions.\n\n* `Empty()` - Clears out the store elements (as well as resizing the buffer to zero).\n* `Reset()` - Clears out the store elements (without resizing the buffer).\n* `GetSlack()` - Gets the number of store elements minus it's buffer size. `Slack = NumOfElements - BufferCapacity`.\n* `GetAllocationSize()` - Gets the buffer capacity.\n* `Shrink()` - It will reset the buffer size to the number of elements, currently being stored.\n* `Reserve()` - It will expand buffer size to that amount. Note, buffer size can change later on.\n* `RemoveAll` - Will remove all elements with prediction as an argument.\n* `RemoveAllSwap` - Same as `RemoveAll()` function, but doesn't preserve the order.\n\nHere's an example:\n\n```cpp\n#include \"Containers/Array.h\"\n\nTArray\u003cint32\u003e Array = { 1, 2, 2, 3, 4, 4, 5 };\n\n// Create a lamba function (which is a temporary function, which takes this class as reference parameter)\nArray.RemoveAll([\u0026](const int32\u0026 Item)\n{\n    // Removes all item, if the item is equal to: 2\n    return Item == 2;\n});\n\n// Current elements: { 1, 3, 4, 4, 5 }\n\nArray.RemoveAllSwap([\u0026](const int32\u0026 Item)\n{\n    // Removes all item, if the item is equal to: 2\n    return Item == 4;\n});\n\n// Current elements: { 5, 3, 1 }\n```\n\n```cpp\n#include \"Containers/Array.h\"\n\nTArray\u003cint32\u003e Array;\nArray.Add(1);\nArray.Add(2);\n\n// Current element count: 2\n// Current buffer size: 4\n\nArray.Empty();\n\n// Current element count: 0\n// Current buffer size: 0\n\nArray.Add(1);\nArray.Add(2);\n\n// Current element count: 2\n// Current buffer size: 4\n\nArray.Reset();\n\n// Current element count: 0\n// Current buffer size: 4\n```\n\n```cpp\nTArray\u003cint32\u003e Array;\nArray.Add(1);\nArray.Add(2);\nArray.Add(3);\nArray.Add(4);\nArray.Add(5);\n\n// Current element count: 5\n// Current buffer size: 22\n\nint32 SlackAmount = Array.GetSlack(); // 22 - 5 = 17 (Slack = BufferCapacity - NumOfElements)\n\nArray.RemoveAt(0);\nArray.RemoveAt(1);\n\n// Current element count: 3\n// Current buffer size: 22\n\nArray.Shrink();\n\n// Current element count: 3\n// Current buffer size: 4\n```\n\n---\n\nIn order to remove an element without allowing the container to shrink, you can use these arguments:\n\n```cpp\n#include \"Containers/Array.h\"\n\nTArray\u003cint32\u003e Array { 1, 2, 3 };\n\n// Removes the last element, without enable the container to shrink itself.\nint32 LastElementIndex = Array.Num() - 1;\nint32 NumToRemove = 1;\nbool bAllowShrinking = false;\nArray.RemoveAt(LastElementIndex, NumToRemove, bAllowShrinking)\n```\n\n---\n\nWhen and how much does the container allocated memory for future use cases?\n\nIf you run a for-loop and running the debugger, we can analyze the allocation size and where the container has its breakpoints for requesting more memory.\n\n```cpp\n#include \"Containers/Array.h\"\n\nvoid UpdatingAllocationSize()\n{\n    TArray\u003cint32\u003e Array;\n\n    int32 PreviousAllocatedSize = Array.GetAllocatedSize();\n\n    for (int32 i = 0; i \u003c 100; ++i)\n    {\n        Array.Add(69);\n\n        int32 NewAllocatedSize = Array.GetAllocatedSize();\n\n        if (PreviousAllocatedSize != NewAllocatedSize)\n        {\n            UE_LOG(LogTemp, Log, TEXT(\"[%s - %s]: Allocation size has changed from: %i to: %i. Current number of elements: %i and current max size: %i\"), ANSI_TO_TCHAR(__FUNCTION__), TEXT(\"Adding\"), PreviousAllocatedSize, NewAllocatedSize, Array.Num(), NewAllocatedSize / sizeof(int32));\n\n            PreviousAllocatedSize = NewAllocatedSize;\n        }\n    }\n\n    // Allocation size is data size times buffer size.\n\n    // Int32 is 4 bytes in size\n    // And the buffer size is currently at 4.\n\n    // Allocation size = 4 * 4 = 16 bytes\n\n    /*\n        LogTemp: Allocation size has changed from: 0 to: 16. Current number of elements: 1 and current max size: 4\n        LogTemp: Allocation size has changed from: 16 to: 88. Current number of elements: 5 and current max size: 22\n        LogTemp: Allocation size has changed from: 88 to: 188. Current number of elements: 23 and current max size: 47\n        LogTemp: Allocation size has changed from: 188 to: 328. Current number of elements: 48 and current max size: 82\n        LogTemp: Allocation size has changed from: 328 to: 520. Current number of elements: 83 and current max size: 130\n    */\n\n    for (int32 i = 0; Array.Num() != 0; ++i)\n    {\n        Array.RemoveAt(Array.Num() - 1);\n\n        int32 NewAllocatedSize = Array.GetAllocatedSize();\n\n        if (PreviousAllocatedSize != NewAllocatedSize)\n        {\n            UE_LOG(LogTemp, Log, TEXT(\"[%s - %s]: Allocation size has changed from: %i to: %i. Current number of elements: %i and current max size: %i\"), ANSI_TO_TCHAR(__FUNCTION__), TEXT(\"Removing\"), PreviousAllocatedSize, NewAllocatedSize, Array.Num(), NewAllocatedSize / sizeof(int32));\n\n            PreviousAllocatedSize = NewAllocatedSize;\n        }\n    }\n\n    /*\n        LogTemp: Allocation size has changed from: 520 to: 260. Current number of elements: 65 and current max size: 65\n        LogTemp: Allocation size has changed from: 260 to: 0. Current number of elements: 0 and current max size: 0\n    */\n}\n```\n\n#### Algo Namespace\n\nAlgo is a namespace containing a lot of helper functions for container.\n\nHere is common functions:\n\n* `Algo::Accumulate()` - Sums a range.\n* `Algo::AllOf()` - Checks if every projection of the elements in the range is truthy.\n* `Algo::AnyOf()` - Checks if any projection of the elements in the range is truthy.\n* `Algo::BinarySearch()` - Returns index to the first found element matching a value in a range, the range must be sorted by `\u003c`\n* `Algo::BinarySearchBy()` - Same as `Algo::BinarySearch()`, but with custom logic.\n* `Algo::Compare()` - Compares two contiguous containers using operator== to compare pairs of elements.\n* `Algo::CompareByPredicate()` - Compares two contiguous containers using a predicate to compare pairs of elements.\n* `Algo::Copy()` - Copies a range into a container.\n* `Algo::CopyIf()` - Conditionally copies a range into a container.\n* `Algo::Count()` - Counts elements of a range that equal the supplied value.\n* `Algo::CountBy()` - Counts elements of a range whose projection equals the supplied value.\n* `Algo::CountIf()` - Counts elements of a range that match a given predicate.\n* `Algo::Find()` - Returns a pointer to the first element in the range which is equal to the given value.\n* `Algo::FindBy()` - Returns a pointer to the first element in the range whose projection is equal to the given value.\n* `Algo::FindLast()` - Returns a pointer to the last element in the range which is equal to the given value.\n* `Algo::FindLastBy()` - Returns a pointer to the last element in the range whose projection is equal to the given value.\n* `Algo::FindSequence()` - Searches for the first occurrence of a sequence of elements in another sequence.\n* `Algo::ForEach()` - Invokes a callable to each element in a range.\n* `Algo::Includes()` - Checks if one sorted contiguous container is a subsequence of another sorted contiguous container by comparing pairs of elements.\n* `Algo::IndexOf()` - Returns the index of the first element in the range which is equal to the given value.\n* `Algo::IndexOfByPredicate()` - Returns the index of the first element in the range which matches the predicate.\n* `Algo::IsSorted()` - Tests if a range is sorted by its element type's operator `\u003c`.\n* `Algo::MaxElement()` - Returns a pointer to the maximum element in a range.\n* `Algo::MinElement()` - Returns a pointer to the minimum element in a range.\n* `Algo::NoneOf()` - Checks if no element in the range is truthy.\n* `Algo::Sort()` - Sort the range. It will default to `\u003c` operator (ascending order). However, custom logic can be added.\n* `Algo::SortBy()` - Same as `Algo::Sort`, but uses a projection method. Projections are transformations but for values.\n* `Algo::RandomShuffle()` - Randomly shuffle a range of elements.\n* `Algo::RemoveIf()` - Moves all elements which do not match the predicate to the front of the range, while leaving all other elements is a constructed but unspecified state.\n* `Algo::Replace()` - Replaces all elements that compare equal to one value with a new value.\n* `Algo::ReplaceIf()` - Replaces all elements that satisfy the predicate with the given value.\n* `Algo::Reverse()` - Reverses a range.\n* `Algo::Transform()` - Applies a transform to a range and stores the results into a container.\n\nYou can read more about Algo on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Algo/).\n\nHere's an example of using them:\n\n```cpp\n#include \"Algo/ForEach.h\"\n#include \"Algo/Accumulate.h\"\n#include \"Algo/IndexOf.h\"\n\nTArray\u003cFString\u003e Array;\nArray.Add(TEXT(\"hello\"));\nArray.Add(TEXT(\"cRuEL\"));\nArray.Add(TEXT(\"WORLD\"));\n\nconst int32 FoundIndex = Algo::IndexOf(Array, FString(TEXT(\"cRuEL\")));\n\nif (FoundIndex != INDEX_NONE)\n{\n    // Successfully found the index\n}\n\nconst int32 FoundIndexPred = Algo::IndexOfByPredicate(Array,\n    [\u0026](const FString\u0026 Arg)\n    {\n        return TEXT(\"hello\") == Arg.ToLower();\n    });\n\nif (FoundIndexPred != INDEX_NONE)\n{\n    // Successfully found the index with prediction\n}\n\nTArray\u003cFString\u003e TransformArray;\n\nAlgo::Transform(Array, TransformArray, [](const FString\u0026 Item) { return Item.ToUpper(); });\n\n// { \"HELLO\", \"CRUEL\", \"WORLD\" }\n\nAlgo::Reverse(TransformArray);\n\n// { \"WORLD\", \"CRUEL\", \"HELLO\" }\n\nTArray\u003cint32\u003e SortArray { 1, 5, 3, -4, 2, -1 };\nAlgo::Sort(SortArray);\n\n// { -4, -1, 1, 2, 3, 5 }\n\n// Create a lambda function for this projection\nauto AbsProjection = [](int32 Value) { return FMath::Abs(Value); };\n\n// Will sort based on this projection. But will still reserve the original values.\nAlgo::SortBy(SortArray, AbsProjection);\n\n// { -1, 1, 2, 3, -4, 5 }\n\nAlgo::ForEach(SortArray, [](int32\u0026 Value)\n{\n    Value *= 2;\n});\n\n// { -2, 2, 4, 6, -8, 10 }\n\n// Will sort based on descending order\nauto ReverseSortPredicate = [](int32 A, int32 B) { return A \u003e B; };\nAlgo::SortBy(SortArray, AbsProjection, ReverseSortPredicate);\n\n// { 10, -8, 6, 4, 2, -2 }\n```\n\n#### TMultiMap\n\nSimilar to `TMap`, but allows multiple values to be associated with the same key. It also provides functions for iterating over all the values associated with a particular key.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/Map.h\"\n```\n\nDeclare a `TMultiMap` of `FName` (names) to floats:\n\n```cpp\nTMultiMap\u003cFName, float\u003e MyMultiMap = { { TEXT(\"X\"), 10.0f }, { TEXT(\"Y\"), 69.0f }, { TEXT(\"Z\"), 0.0f } }\n```\n\nAdd elements to the map:\n\n```cpp\nMyMultiMap.Add(TEXT(\"X\"), -10.0f);\nMyMultiMap.Add(TEXT(\"Y\"), 69.0f);\nMyMultiMap.AddUnique(TEXT(\"Y\"), 69.0f); // Will not add if both key and value match an existing association in the map!\n\n// MyMultiMap: { { TEXT(\"X\"), 10.0f }, { TEXT(\"Y\"), 69.0f }, { TEXT(\"Z\"), 0.0f }, { TEXT(\"Y\"), 69.0f }, { TEXT(\"X\"), -10.0f } }\n```\n\nGet all values for a key in the map:\n\n```cpp\nTArray\u003cfloat\u003e OutValues;\nMyMultiMap.MultiFind(TEXT(\"Y\"), OutValues);\n\n// OutValues: { 69.0f, 69.0f }\n```\n\nGet number of elements from the multi-map:\n\n```cpp\nint32 NumOfElements = MyMultiMap.Num(); // 5\n```\n\nLoop through the values and log each one:\n\n```cpp\nfor (const float\u0026 Value : OutValues)\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Value: %f\"), Value);\n}\n```\n\nRemove all values for a key in the map:\n\n```cpp\nMyMultiMap.Remove(TEXT(\"Y\"));\n\n// MyMultiMap: { { TEXT(\"X\"), 10.0f }, { TEXT(\"Z\"), 0.0f }, { TEXT(\"X\"), -10.0f } }\n```\n\nRemove the first association between the specified key and value from the map:\n\n```cpp\nMyMultiMap.RemoveSingle(TEXT(\"X\"), 10.0f);\n\n// MyMultiMap: { { TEXT(\"Z\"), 0.0f }, { TEXT(\"X\"), -10.0f } }\n```\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TMultiMap/).\n\n\u003e [!WARNING]\n\u003e Unreal doesn't support `TMultiMap` with UHT[^2]. Meaning, you can't expose to Blueprint.\n\n#### TStaticArray\n\nAn array with a static number of elements.\n\nYou cannot add or remove any of the entries of the static array. But you can still alter each element's data.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/StaticArray.h\"\n```\n\nDeclare a `TStaticArray` of `int32` (integers) with 4 elements pre-allocated:\n\n```cpp\n// Allocate 4 elements of type 'FVector'\nTStaticArray\u003cFVector, 4\u003e StaticArray;\n\n// StaticArray: { (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0) }\n```\n\nYou **CANNOT** use brace initialization with `TStaticArray`:\n\n```cpp\nTStaticArray\u003cint32, 4\u003e StaticArray { 1, 2, 3, 4 }; // Won't compile!\n```\n\nUpdate each element's value:\n\n```cpp\nStaticArray[0] = FVector::OneVector;\nStaticArray[1] = FVector::ZeroVector;\nStaticArray[2] = FVector::OneVector;\nStaticArray[3] = FVector::ZeroVector;\n\n// StaticArray: { (1, 1, 1), (0, 0, 0), (1, 1, 1), (0, 0, 0) }\n```\n\nGet number of elements from the static array:\n\n```cpp\nint32 NumOfElements = StaticArray.Num(); // 4\n```\n\nLoop through the values and log each one:\n\n```cpp\nfor (const FVector\u0026 Vec : StaticArray)\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Value: %s\"), *Vec.ToString());\n}\n```\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TStaticArray/).\n\n\u003e [!WARNING]\n\u003e Unreal Engine doesn't support `TStaticArray` with UHT[^2]. Meaning, you can't expose to Blueprint. To use a static array with Blueprint, use `FixedSized` specifier for UPROPERTY on `TArray` property.\n\n#### FHashTable\n\nDynamically sized hash table, used to index another data structure.\nVastly simpler and faster than `TMap`.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/HashTable.h\"\n```\n\nDefine a `FHashTable`:\n\n```cpp\nFHashTable HashTable;\n```\n\nAdd a new hash element to the table:\n\n```cpp\nconst uint16 Hash = 50u;\nconst uint16 Index = 10u;\n\nHashTable.Add(Hash, Index);\n```\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/FHashTable/).\n\n#### TStaticHashTable\n\nStatically sized hash table, used to index another data structure.\nVastly simpler and faster than `TMap`.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/HashTable.h\"\n```\n\nDefine a `TStaticHashTable`:\n\n```cpp\nstatic const uint32 Capacity = 16u;\nTStaticHashTable\u003c1024u, Capacity\u003e StaticHashTable;\n```\n\nAdd a new hash element to the table:\n\n```cpp\nconst uint16 Hash = 50u;\nconst uint16 Index = 10u;\n\nStaticHashTable.Add(Hash, Index);\n```\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TStaticHashTable/).\n\n#### TSortedMap\n\nA Map of keys to value, implemented as a sorted `TArray` of TPairs.\n\nIt has a mostly identical interface to `TMap` and is designed as a drop in replacement. Keys must be unique, there is no equivalent sorted version of `TMultiMap`. It uses half as much memory as `TMap`, but adding and removing elements is O(n), and finding is O(Log n). In practice it is faster than `TMap` for low element counts, and slower as n increases, This map is always kept sorted by the key type so cannot be sorted manually.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/SortedMap.h\"\n```\n\nCreate a `TSortedMap` of `FName` (names) to `int32` (integers):\n\n```cpp\nTSortedMap\u003cFName, int32\u003e MyMap;\n```\n\nAdd some elements to the map:\n\n```cpp\nMyMap.Add(TEXT(\"One\"), 1);\nMyMap.Add(TEXT(\"Two\"), 2);\nMyMap.Add(TEXT(\"Three\"), 3);\n```\n\nGet the value associated with a key:\n\n```cpp\nint32 Value = MyMap[TEXT(\"One\")];\n```\n\nCheck if a key exists in the map:\n\n```cpp\nbool Exists = MyMap.Contains(TEXT(\"One\"));\n```\n\nIterate over the map and log each one:\n\n```cpp\nfor (const TPair\u003cFName, int32\u003e\u0026 Element : MyMap)\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Key: %s, Value: %i\"), *Element.Key.ToString(), Element.Value);\n}\n```\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TSortedMap/).\n\n#### TList\n\nSimple single-linked list template.\n\nIt only stores two things:\n\n```cpp\nElementType\t\t\tElement; // Value\nTList\u003cElementType\u003e* Next; // Pointer to the next node\n```\n\nHelpful for scenarios like: Pathfinding, binary tree searching or dialogue tree system.\n\nA linked list have some benefits compare to `TArray`, mainly it has **O(1)** in time complexity, for adding and removing elements in the list. This is because, every node has a pointer to the next node in the list. Thus giving `TList` a time complexity to **O(1)**.\n\nYou can read more about [time complexity by Joel Olawanle](https://www.freecodecamp.org/news/big-o-cheat-sheet-time-complexity-chart/).\n\nThere is a couple of downsides of using `TList` compare to `TArray`:\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\nCache misses\n\nWhen the computer reads the memory, it reads from RAM (Random-access memory). Hence, the name it will access the memory at random location. With `TArray`, your memory allocation contiguous. Meaning, that `TArray` will ask for a big spot to have its memory block.\n\nHowever, if `TArray` cannot find nor fit a specific spot (as the `TArray` can grow and shrink), it needs to recalculate and find a new spot. Thus making it annoying to add or to remove elements.\n\nBut what `TArray` have which a linked list lacks is **cache hits**. Cache hits is a terminology, where the CPU can preload an array into CPU cached memory. Because an array stores in contiguous, allows the CPU to preload the whole array without jumping back and forth in memory location.\n\nWith linked lists, there is no contiguous memory. Meaning, the CPU needs to find each node in different location. Which doesn't allow the CPU to cache previous result into its memory. And this called a cache miss.\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/LinkedListMemory.png\" alt=\"Linked List's memory allocation\" /\u003e\n    \u003cfigcaption\u003eImage from \u003ca href=\"https://dhathriblog.medium.com/linked-list-data-structure-dc13fd807096\"\u003eDhathri Vupparapalli's blog\u003c/a\u003e.\u003c/figcaption\u003e\n\u003c/figure\u003e\n\nHere is a video from [SimonDev about cache misses and hits](https://www.youtube.com/watch?v=247cXLkYt2M).\n\nYou can also read more about the [CPU's cache on Wikipedia](https://en.wikipedia.org/wiki/Cache_(computing)).\n\n---\n\nMemory space\n\n`TList` takes up more memory space per each node.\n\nSince every node needs to keep track of the next node in the list. And the next variable is a pointer, which takes up 4 bytes in 32-bit and 8 bytes in 64-bit computers.\n\nAnd if you just want to use primary data types, such as (`int`, `float`, `double`, `bool` or `char`), then you can just use `TArray` instead. Whilst a `TArray` stores some overhead, it's very minimal overhead.\n\n---\n\nNo helper functions\n\n`TList` only offers the data element and the next node (as a pointer variable).\n\n`TList` does **NOT** offer any helper functions for adding or removing a node in the list.\n\nIf you wish to have these functions, then you can just use `TLinkedList` instead.\n\n---\n\nOnly goes forward\n\nWith `TList`, you can only forwards.\n\nThis is becuase there is no previous node per node. Meaning, you cannot go backwards in the list.\n\nIf you wish to go backwards, then you can just use `TDoubleLinkedList` instead.\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/List.h\"\n```\n\n```cpp\n// Create the head of the list with data value of 69\nTList\u003cint32\u003e Head(69);\n\n// Create a new node with data 1337 and link it to the head\nHead.Next = new TList\u003cint32\u003e(1337);\n\n// Create another node with data 3 and link it to the previous node\nHead.Next-\u003eNext = new TList\u003cint32\u003e(3);\n\n// Re-assign the data value\nHead.Next-\u003eNext-\u003eNext.Element = 420;\n\n// Print the elements in the linked list\nTList\u003cint32\u003e* CurrentNode = \u0026Head;\n\nwhile (CurrentNode != nullptr)\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Element: %i\"), CurrentNode-\u003eElement);\n    CurrentNode = CurrentNode-\u003eNext;\n}\n```\n\n\u003e [!NOTE]\n\u003e `TList` doesn't offer an insert nor a remove function for each node. If you wish to use those function, then use `TLinkedList`.\n\n\u003e [!NOTE]\n\u003e As a rule of thumb, you should almost always use `TArray`, unless you have specific reasons to use a linked list.\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TList/).\n\n#### TLinkedList\n\nEncapsulates a link in a single linked list with constant access time.\n\nThis linked list is non-intrusive, i.e. it stores a copy of the element passed to it (typically a pointer)\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/List.h\"\n```\n\nDefine a `TLinkedList` of `int32` (integer):\n\n```cpp\nTLinkedList\u003cint32\u003e HeadNode;\n```\n\nIterate over the linked list using `TIterator`:\n\n```cpp\nfor (TLinkedList\u003cint32\u003e::TIterator It(\u0026HeadNode); It; It.Next())\n{\n    // Get the value at the current position of the iterator\n    int32 Value = *It;\n\n    // Log the value.\n    UE_LOG(LogTemp, Log, TEXT(\"Value: %i\"), Value);\n}\n```\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TLinkedList/).\n\n#### TDoubleLinkedList\n\nIt only stores three things:\n\n```cpp\nElementType            Value;\nTDoubleLinkedListNode* NextNode;\nTDoubleLinkedListNode* PrevNode;\n```\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/List.h\"\n```\n\nDefine a `TDoubleLinkedList` of `int32` (integers):\n\n```cpp\nTDoubleLinkedList\u003cint32\u003e A;\n```\n\nAdd node to the head/tail of the list:\n\n```cpp\nA.AddHead(69);\nA.AddTail(1337);\n```\n\nGet the number of elements in the list:\n\n```cpp\nint32 NumOfElements = A.Num();\n```\n\nCheck if the list contains the value 5:\n\n```cpp\nbool bContains = A.Contains(5);\n```\n\nFind a node with value 1 in the list:\n\n```cpp\nTDoubleLinkedList\u003cint32\u003e::TDoubleLinkedListNode* Node = A.FindNode(1);\n\n// Log the value of the found node\nif (Node != nullptr)\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Value of the node: %i\"), Node-\u003eGetValue());\n}\nelse\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Node with value 1 not found.\"));\n}\n```\n\nGet the next node and previous node in the list:\n\n```cpp\nTDoubleLinkedList\u003cint32\u003e::TDoubleLinkedListNode* NextNode = Node-\u003eGetNextNode();\nTDoubleLinkedList\u003cint32\u003e::TDoubleLinkedListNode* PrevNode = Node-\u003eGetPrevNode();\n\n// Log the values of the next and previous nodes\nif (NextNode != nullptr)\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Value of the next node: %i\"), NextNode-\u003eGetValue());\n}\nelse\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Next node is null.\"));\n}\n\nif (PrevNode != nullptr)\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Value of the previous node: %i\"), PrevNode-\u003eGetValue());\n}\nelse\n{\n    UE_LOG(LogTemp, Log, TEXT(\"Previous node is null.\"));\n}\n```\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TDoubleLinkedList/).\n\n#### TQueue\n\nThis template implements an unbounded non-intrusive queue using a lock-free linked list that stores copies of the queued items. The template can operate in two modes: Multiple-producers single-consumer (MPSC) and Single-producer single-consumer (SPSC).\n\nThe queue is thread-safe in both modes. The `Dequeue()` method ensures thread-safety by writing it in a way that does not depend on possible instruction reordering on the CPU. The `Enqueue()` method uses an atomic compare-and-swap in multiple-producers scenarios.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/Queue.h\"\n```\n\nDefine a `TQueue` of `FHitResult` (hit results):\n\n```cpp\nTQueue\u003cFHitResult\u003e MyQueue;\n```\n\nAdd some elements to the queue:\n\n```cpp\nAActor* TargetActor = this;\nUPrimitiveComponent* TargetComponent = this;\nFVector HitLocation = FVector(900.0f, 0.0f, 500.0f);\nFVector HitNormal = FVector(0.0f, 0.0f, 1.0f);\n\nMyQueue.Enqueue(FHitResult(TargetActor, TargetComponent, HitLocation, HitNormal));\nMyQueue.Enqueue(FHitResult(nullptr, nullptr, FVector::ZeroVector, FVector::OneVector.GetSafeNormal()));\n```\n\nDequeue the first element in the queue:\n\n```cpp\nFHitResult DequeuedElement = MyQueue.Dequeue();\n```\n\nCheck if the queue is empty:\n\n```cpp\nbool IsEmpty = MyQueue.IsEmpty();\n```\n\nIterate over the queue:\n\n```cpp\nwhile (!MyQueue.IsEmpty())\n{\n    FHitResult HitResult = MyQueue.Dequeue();\n\n    UE_LOG(LogTemp, Log, TEXT(\"Hit Target: %s\"), *HitResult.GetActor()-\u003eGetName());\n}\n```\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TQueue/).\n\n#### TArrayView\n\nWhen you want to reuse an array without copying or referencing the base class, you can use `TArrayView`.\n\nA statically sized view of an array of typed elements. Designed to allow functions to take either a fixed C-style array or a `TArray` with an arbitrary allocator as an argument when the function neither adds nor removes elements.\n\nYou can read more about from [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TArrayView/).\n\nHere's an example:\n\n```cpp\n#include \"Containers/Array.h\"\n#include \"Containers/ArrayView.h\"\n\n#include \"Algo/ForEach.h\"\n#include \"Algo/Accumulate.h\"\n\nint32 SumArray(TArrayView\u003cconst int32\u003e ArrayView)\n{\n    // Sum the array\n    return Algo::Accumulate(ArrayView, 0);\n}\n\n// Allocates on heap, but returns an array on the stack\nTArray\u003cint32\u003e RegularArray = { 1, 2, 3 };\n\n // Allocates on the stack\nTArray\u003cint32, TInlineAllocator\u003c4\u003e\u003e StackAllocatedArray = { 1, 2, 3 };\n\n // Allocates on the stack\nint32 CArray[4] = { 1, 2, 3 };\n\nUE_LOG(LogTemp, Log, TEXT(\"Sum=%i\"), SumArray(RegularArray));\n\nUE_LOG(LogTemp, Log, TEXT(\"Sum=%i\"), SumArray(StackAllocatedArray));\n\nUE_LOG(LogTemp, Log, TEXT(\"Sum=%i\"), SumArray(CArray));\n```\n\n\u003e [!WARNING]\n\u003e `TArrayView` is a fixed size and independent array. Meaning, it will not affect from its original assignment, nor does it support Add() or Remove() functions.\n\n\u003e [!NOTE]\n\u003e It's still possible to use Algo library, which offers functions to use for TArrayView and TArray. Such as Algo::Reverse() and Algo::ForEach().\n\n\u003e [!CAUTION]\n\u003e Avoid using `TArrayView` with a temporary array variable. Since, the array can go out of scope, which then will make `TArrayView` variable invalid and point to a different memory block. This is because the view is relying on the array's memory block.\n\n```cpp\n#include \"Containers/ArrayView.h\"\n\n// Note how to mark an ArrayView const!\nvoid ConstArrayView()\n{\n    TArray\u003cint32\u003e MutableArray;\n    TArrayView\u003cint32\u003e ArrayView = MutableArray;\n    TArrayView\u003cconst int32\u003e ConstArrayView = MutableArray;\n\n    ArrayView[0] = 1337; // Allowed!\n    ConstArrayView[0] = 69; // Compiling error!\n}\n\n// Do not create an array view to a temporary variable, as this can cause issues!\nvoid UnsafeArrayView()\n{\n    // Create Array view with temporary TArray\n    TArrayView\u003cconst int32\u003e UnsafeArray = TArray\u003cint32\u003e { 1, 2, 3 };\n\n    // This memory block has likely been freed, but the array view doesn't know about it!\n    int32 Value = UnsafeArray[0]; // This will cause a crash!\n}\n\n// Do not modify the array while the array view is in scope! Array view is independent from the array.\nvoid ModifyArrayView()\n{\n    TArray\u003cint32\u003e Array { 1, 2, 3 };\n    TArrayView\u003cint32\u003e ArrayView = Array;\n\n    int32 PreviousValue = ArrayView[0];\n\n    Array.RemoveAt(0); // Will not update array view!\n\n    int32 NewValue = ArrayView[0];\n\n    bool bIsSame = PreviousValue == NewValue; // Will return true!\n}\n```\n\n#### String View\n\n`FStringView` is a lightweight, non-owning view of the string data, and copying the view itself is efficient and does not affect the underlying data. However, when you copy the `FStringView`, the new instance of the view still refers to the same original string data.\n\nSame concept with `TArrayView` but with `FString` instead.\n\nHere's an example:\n\n```cpp\n#include \"Containers/UnrealString.h\"\n\nvoid ProcessString(FStringView StringView)\n{\n    // Use FStringView to read the string data without copying it.\n    UE_LOG(LogTemp, Log, TEXT(\"String: %s\"), *StringView);\n}\n\nFString MyString = TEXT(\"Hello, FStringView!\");\n\n// Pass FString as FStringView to the function without copying the data.\nProcessString(MyString);\n\n// Copy FStringView to another variable.\nFStringView CopiedStringView = MyString;\n\n// Modifying the original FString does not affect the copied FStringView.\nMyString = TEXT(\"Modified String\");\n\n// Print the contents of the copied FStringView.\nUE_LOG(LogTemp, Log, TEXT(\"Copied StringView: %s\"), *CopiedStringView);\n```\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TStringView/).\n\n#### String Builder\n\nWhen working strings, you might have to concatenate a lot of string together. Sometimes, this can create complex and messy code to read. Whilst, `FString` is **mutable** and allows the developer to alter its data without copy a new instance. A string builder can still be a very helpful tool.\n\nThe string builder allocates a buffer space which is used to hold the constructed string. The intent is that the builder is allocated on the stack as a function local variable to avoid heap allocations.\n\nThe buffer is always contiguous, and the class is not intended to be used to construct extremely large strings.\n\nThis is not intended to be used as a mechanism for holding on to strings for a long time. The use case is explicitly to aid in constructing strings on the stack and subsequently passing the string into a function call or a more permanent string storage mechanism like `FString` et al.\n\nThe amount of buffer space to allocate is specified via a template parameter and if the constructed string should overflow this initial buffer, a new buffer will be allocated using regular dynamic memory allocations.\n\n---\n\n**There are two ways to construct a string builder**. Either with initialize buffer size or with unknown buffer size.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/StringFwd.h\"\n```\n\nTo create a string builder with an unknown buffer size:\n\n```cpp\nFStringBuilderBase StringBuilder; // Note! This is using a regular dynamic memory allocation.\n```\n\nTo create a string builder with initialize buffer size:\n\n```cpp\nint32 BufferSize = 12; // 12 characters of TCHAR\nTStringBuilder\u003cBufferSize\u003e StringBuilder;\n```\n\nAppend characters to the string builder:\n\n```cpp\nStringBuilder.Appendchar('H');\nStringBuilder.Appendchar('e');\nStringBuilder.Appendchar('l');\nStringBuilder.Appendchar('l');\nStringBuilder.Appendchar('o');\nStringBuilder.Appendchar(',');\nStringBuilder.Appendchar(' ');\nStringBuilder.Appendchar('W');\nStringBuilder.Appendchar('o');\nStringBuilder.Appendchar('r');\nStringBuilder.Appendchar('l');\nStringBuilder.Appendchar('d');\n\n// StringBuilder: { 'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd' }\n```\n\nIn order to get the string either call `ToString()` or `ToView()` functions:\n\n```cpp\nFString Str = StringBuilder.ToString();\nFStringView StrView = StringBuilder.ToView();\n```\n\nYou can also append a string as well:\n\n```cpp\n// Note! The string builder will allocate more memory, if necessary.\n\n// We only allocated 12 characters, and this call will make it go over bound.\n// Causing to allocate more memory on heap.\nStringBuilder.Append(TEXT(\" and welcome!\"));\n\n// StringBuilder: { 'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', ' ', 'a', 'n', 'd', ' ', 'w', 'e', 'l', 'c', 'o', 'm', 'e', '!' }\n```\n\n\u003e [!WARNING]\n\u003e The string builder will allocate more memory, if necessary.\n\nHere's an another example:\n\n```cpp\nTStringBuilder\u003c256\u003e MessageBuilder;\n\nfloat PlayerHealth = 110.5285f;\nMessageBuilder \u003c\u003c TEXTVIEW(\"Player's health: \") \u003c\u003c FString::SanitizeFloat(PlayerHealth);\n\nreturn FString { MessageBuilder };\n```\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TStringBuilderBase/).\n\n#### TEnumAsByte\n\nTemplate to store enumeration values as bytes in a type-safe way.\n\n**Here's an example:**\n\nInclude the header file:\n\n```cpp\n#include \"Containers/EnumAsByte.h\"\n```\n\nDeclare a `TEnumAsByte` with the enumeration type `ECollisionChannel`:\n\n```cpp\nTEnumAsByte\u003cECollisionChannel\u003e Channel;\n```\n\nGet the value of the `TEnumAsByte`:\n\n```cpp\nECollisionChannel Val = Channel.GetValue();\n```\n\nGet the integer value of the `TEnumAsByte`:\n\n```cpp\nint32 IntVal = Channel.GetIntValue();\n```\n\nAssign a new value to the `TEnumAsByte`\n\n```cpp\nChannel = ECollisionChannel::ECC_Camera;\n```\n\nLog the values:\n\n```cpp\nUE_LOG(LogTemp, Log, TEXT(\"Value of the: %i\"), UEnum::GetValueAsName(Val));\nUE_LOG(LogTemp, Log, TEXT(\"Integer value of the: %i\"), IntVal);\n```\n\n\u003e [!NOTE]\n\u003e That regular enums are supported by `UPROPERTY` and replaces the need of using `TEnumAsByte` anymore.\n\nYou can read more about it on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Core/Containers/TEnumAsByte/).\n\n### 🧨 Value type vs Reference type\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nLet's talk about what value type and reference types.\n\nIn various programming languages like Python[^11], Java[^13], and C#[^12], you may have encountered both value types and reference types.\n\nA value type creates a copy when initialized from another variable. For instance, let's consider variable A, and when we initialize variable B with the value of A, a separate copy of the value is created in B. Essentially, B is an independent entity that holds its own value.\n\n```cpp\nint A = 69;\nint B = A; // A copy\n```\n\nOn the other hand, a reference type directly references the memory location of the variable. In this case, when variable B is initialized by variable A, B becomes a reference to the same memory location as A. Consequently, any changes made to B will also affect A since B essentially points to the same underlying value as A.\n\n```cpp\nint A = 69;\nint\u0026 B = A; // A reference\n```\n\nEverything in C++ is value type by default. Even classes, which differ from C#[^12].\n\nYou can watch this video about [references in C++ from Low Level Learning](https://www.youtube.com/watch?v=wro8Bb6JnwU).\n\nHere's an example:\n\n```cpp\n// Test struct and class\nstruct Coords\n{\n    // Constructor: Initialize X and Y with given values\n    Coords(int x, int y) : X(x), Y(y) {}\n\npublic:\n    int X; // X coordinate\n    int Y; // Y coordinate\n\npublic:\n    // Return a string representation of this Coords struct\n    std::string toString() const\n    {\n        // Use stringstream to concatenate strings\n        std::stringstream ss;\n        ss \u003c\u003c \"(\" \u003c\u003c X \u003c\u003c \", \" \u003c\u003c Y \u003c\u003c \")\";\n        return ss.str();\n    }\n};\n\nint main()\n{\n    Coords A(1, 2); // Create struct A\n    Coords\u0026 B = A; // B is a reference to A\n    Coords* C = \u0026B; // C is a pointer to A\n    Coords* D = new Coords(5, 10); // Create a new Coords struct with new\n    Coords* E = \u0026(*C); // E is a pointer to what C points to\n\n    B.X = 69; // Modify X of A through B\n    C-\u003eY = 1337; // Modify Y of A through C\n    D-\u003eY = D-\u003eY * 2; // Modify Y of dynamically allocated struct\n\n    E = \u0026*D; // Make E point to what D points to\n    E-\u003eX = 10; // Modify X of dynamically allocated struct\n\n    // Print statements\n    std::cout \u003c\u003c A.toString() \u003c\u003c std::endl;\n    std::cout \u003c\u003c B.toString() \u003c\u003c std::endl;\n    std::cout \u003c\u003c C-\u003etoString() \u003c\u003c std::endl;\n    std::cout \u003c\u003c D-\u003etoString() \u003c\u003c std::endl;\n    std::cout \u003c\u003c E-\u003etoString() \u003c\u003c std::endl;\n\n    delete D; // Deallocate memory of dynamically allocated struct\n\n    return 0;\n}\n```\n\nWith references, you can only assign them once, and they cannot be changed throughout the code. For example, you can have a direct reference to an argument passed into a function. This argument can then be modified within the function, similar to how an [out](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/out-parameter-modifier) parameter works in C#[^12].\n\nHere's an example:\n\n```cpp\nbool DamageHealth(int\u0026 Health)\n{\n   Health -= 100; // Modifying the value through the reference\n   return Health \u003c= 0;\n}\n\nint PlayerHealth = 100;\n\nif (DamageHealth(PlayerHealth)) // Passing the `PlayerHealth` as a direct reference\n{\n   // Player just died!\n}\n```\n\n### 👈 Pointers\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n![Pointers](static/img/Pointers.png)\n\nAnd lastly, we have pointers. This section, will go over about raw pointers and smart pointers. If you have no clue about pointers, highly recommend watching [Cherno about pointers](https://www.youtube.com/watch?v=DTxHyVn0ODg).\n\nPointers and references are similar in that they both refer to variables, but there's one key difference. Pointers are **indirect references**, meaning they can change throughout the code, pointing to different variables. On the other hand, regular references are **direct** and can only **refer to the specific variable** they were initialized with.\n\n_In a short summary, a pointer is like writing down the address of a building on a piece of paper. The address on the paper tells you where the building is located, just as the memory address stored in the pointer variable tells you where a variable is located in memory. Similarly, you can also pass the address on the paper to someone else, allowing them to find the building too, just as you can pass a pointer variable to a function or another part of your code, allowing it to access the variable in memory._\n\nPointers are valuable tools in programming as they allow us to store memory addresses, enabling dynamic memory allocation and manipulation of data structures. By using pointers, we can create more flexible and efficient code that can adapt to changing data requirements during program execution.\n\nAdditionally, pointers are essential in scenarios like data structures, linked lists, and passing data to functions by reference, providing a level of control and precision that enhances the capabilities of the program. However, **it's important to handle pointers with care**, as incorrect usage can lead to **memory leaks** or **segmentation faults**.\n\n#### 🦴 Raw pointers\n\nA raw pointer can be sometime dangerous, because there is no validation when accessing this pointer. And when the pointer is pointing to nothing (meaning, the pointer is a `nullptr`). The program will throw a null pointer exception, also known as a segmentation fault (segfault).\n\nA segmentation fault occurs when a program tries to access a memory location that it does not have permission to access, which can happen when the program tries to dereference a null pointer. When this happens, the operating system will usually terminate the program and generate an error message.\n\nYou can read more about [raw pointers from Microsoft Learn](https://learn.microsoft.com/en-us/cpp/cpp/raw-pointers?view=msvc-170).\n\nTo avoid this, you must check before if the pointer is valid, before using it.\n\n\u003e [!CAUTION]\n\u003e Use the function called `IsValid()` for raw pointers, which doing any operations with it.\n\nHere's an example:\n\n```cpp\nUPROPERTY()\nAActor* ActorPtr = nullptr;\n\n// Use UPROPERTY() macro, in order to tell the UHT[^2] (Unreal Header Tool), this pointer must be release into GC (garbage collector).\n// If not, then this will cause a memory leak. Meaning, the pointer is still alive, even tough we are not using this memory block.\n\nvoid KillActor()\n{\n  // IsValid() function also check if the pointer is not already destroyed by the GC (garbage collector).\n\n  if (!IsValid(ActorPtr)) // The pointer has value of 'nullptr', therfore is NOT valid!\n      return;\n\n  ActorPtr-\u003eDestroy();\n}\n```\n\n\u003e [!NOTE]\n`ActorPtr` is marked with `UPROPERTY()`in order to tell UHT[^2], that this pointer exists. When the pointer is unused, the garbage collector then marks it and deletes its memory. Also note, that this process can take a couple frames and is not instantaneously. Therefore, always use `IsValid()` function, which also checks if the pointer is not marked for the garbage collector. Avoid using manual checking, like this: `PlayerCharacter != nullptr` (since it will not work with GC system).\n\n\u003e [!WARNING]\n\u003e If something else is referencing `ActorPtr`, the pointer will not be destroyed via garbage collection (unless if it's a weak pointer).\n\nAfter Unreal Engine (**5.0**) version, is now recommending to use `TObjectPtr` instead of `*` to mark raw pointers. `TObjectPtr` class contains some optimization for the editor.\n\nHere is the updated code:\n\n```cpp\nUPROPERTY()\nTObjectPtr\u003cAActor\u003e ActorPtr = nullptr;\n```\n\n#### 🤖 Smart pointers library\n\nIn Unreal Engine, the Smart Pointer's library provides a set of template classes to manage memory and object ownership more efficiently and safely. These smart pointers automatically handle memory management, such as allocating and deallocating memory, and help prevent memory leaks and null pointer dereferences.\n\nThe key smart pointers in Unreal Engine's library include `TSharedPtr`, `TWeakPtr`, and `TUniquePtr`. They are designed to handle various ownership scenarios and provide a safer alternative to raw pointers.\n\nYou can read more about [Unreal Smart Pointer Library on their docs](https://docs.unrealengine.com/5.2/en-US/smart-pointers-in-unreal-engine/).\n\n##### TSharedPtr\n\n`TSharedPtr` is a smart pointer that manages shared ownership of a dynamically allocated object. It uses reference counting to keep track of the number of shared references to the object and automatically releases the memory when the last reference goes out of scope.\n\nExample:\n\n```cpp\nTSharedPtr\u003cint32\u003e sharedPtr = MakeShared\u003cint32\u003e(42);\n```\n\n##### TWeakPtr\n\n`TWeakPtr` is a smart pointer that represents a weak reference to a dynamically allocated object. It allows accessing the object as long as it exists but does not affect the object's reference count. It is commonly used to avoid circular reference issues.\n\nExample:\n\n```cpp\nTSharedPtr\u003cint32\u003e sharedPtr = MakeShared\u003cint32\u003e(42);\nTWeakPtr\u003cint32\u003e weakPtr = sharedPtr;\n```\n\n##### TUniquePtr\n\n`TUniquePtr` is a smart pointer that represents sole ownership of a dynamically allocated object. It ensures that only one pointer can own the object, and when the owning `TUniquePtr` goes out of scope, the memory is automatically deallocated.\n\nExample:\n\n```cpp\nTUniquePtr\u003cint32\u003e uniquePtr = MakeUnique\u003cint32\u003e(42);\n```\n\n#### 🤖 Smart `UObject` pointers\n\nUnreal Engine's Smart Pointers, such as `TSharedPtr`, `TWeakPtr`, and `TUniquePtr`, are generic smart pointers that can be used with any C++ classes or types, not limited to Unreal Engine's UObject-derived classes.\n\nOn the other hand, UObject Smart Pointers are specific to Unreal Engine's UObject-derived classes. These smart pointers, such as `TWeakObjectPtr`, `TWeakInterfacePtr`, `TSoftObjectPtr` and `TSoftClassPtr`, are designed to handle `UObject` ownership and management within the Unreal Engine ecosystem.\n\n##### TWeakObjectPtr\n\nThis smart pointer is used to hold a weak reference to an `UObject` subclass. It allows you to safely reference an object without affecting its lifespan. It is commonly used to prevent strong references that could potentially create circular dependencies.\n\nExample usage:\n\n```cpp\nTWeakObjectPtr\u003cUObject\u003e WeakPtr;\n\nif (SomeObject.IsValid())\n{\n    WeakPtr = SomeObject;  // Assign weak reference to an object\n}\n\nif (WeakPtr.IsValid())\n{\n    // Access the object if it still exists\n    WeakPtr-\u003eDoSomething();\n}\n```\n\n##### TWeakInterfacePtr\n\nThis smart pointer is used to hold a weak reference to an interface implemented by an `UObject`. It allows you to safely reference the interface without affecting its lifespan.\n\nExample usage:\n\n```cpp\nTWeakInterfacePtr\u003cIMyInterface\u003e WeakPtr;\n\nif (SomeObject-\u003eImplements\u003cIMyInterface\u003e())\n{\n    WeakPtr = SomeObject;  // Assign weak reference to the interface\n}\n\nif (WeakPtr.IsValid())\n{\n    // Access the interface if the object still implements it\n    WeakPtr-\u003eInterfaceFunction();\n}\n```\n\n##### TSoftObjectPtr\n\nThis smart pointer is used to hold a soft reference to an `UObject` subclass. It is used for referencing assets that can be loaded and unloaded during runtime. Soft references do not prevent the asset from being garbage collected.\n\n![TSoftObjectPtr](static/img/TSoftObjectPtr_BP.png)\n\nExample usage:\n\n```cpp\nTSoftObjectPtr\u003cUTexture2D\u003e SoftPtr; // Assign soft reference to a texture asset\n\nif (SoftPtr.IsValid())\n{\n    UTexture2D* Texture = SoftPtr.LoadSynchronous(); // This will cause a lag spike (if the asset is heavily chained or large in size)\n\n    if (Texture)\n    {\n        // Use the loaded texture\n    }\n}\n```\n\nAsynchronous Solution:\n\n```cpp\nTSoftObjectPtr\u003cUTexture2D\u003e SoftPtr; // Assign soft reference to a texture asset\n\nif (SoftPtr.IsValid())\n{\n    OnTextureLoadedDelegate.BindLambda([]()\n    {\n        // Called when the texture is loaded and ready to use\n        UTexture2D* Texture = SoftPtr.Get();\n\n        if (Texture)\n        {\n            // Use the loaded texture as needed\n        }\n    });\n\n    StreamableManager.RequestAsyncLoad(SoftPtr.ToSoftObjectPath(), OnTextureLoadedDelegate);\n}\n```\n\n\u003e [!WARNING]\n\u003e Don't use `FSoftObjectPath` or `FSoftObjectPtr`. Used for internal purpose.\n\n##### TSoftClassPtr\n\nThis smart pointer is used to hold a soft reference to a `UClass` subclass. It is used for referencing blueprint classes or other classes that can be loaded and unloaded during runtime.\n\n![TSoftClassPtr](static/img/TSoftClassPtr_BP.png)\n\nExample usage:\n\n```cpp\nTSoftClassPtr\u003cAMyBlueprintClass\u003e SoftPtr; // Assign soft reference to a blueprint class\n\nif (SoftPtr.IsValid())\n{\n    UClass* Class = SoftPtr.LoadSynchronous(); // This will cause a lag spike (if the asset is heavily chained or large in size)\n\n    if (Class)\n    {\n        // Use the loaded class\n    }\n}\n```\n\nAsynchronous Solution:\n\n```cpp\nTSoftClassPtr\u003cAMyBlueprintClass\u003e SoftPtr; // Assign soft reference to a blueprint class\n\nif (SoftPtr.IsValid())\n{\n    OnBlueprintLoadedDelegate.BindLambda([]()\n    {\n        // Called when the blueprint class is loaded and ready to use\n        UClass* BlueprintClass = SoftPtr.Get();\n\n        if (BlueprintClass)\n        {\n            // Use the loaded blueprint class as needed\n            AMyBlueprintClass* NewActor = GetWorld()-\u003eSpawnActor\u003cAMyBlueprintClass\u003e(BlueprintClass);\n\n            if (NewActor)\n            {\n                // Successfully spawned the actor based on the loaded blueprint class\n            }\n        }\n    });\n\n    StreamableManager.RequestAsyncLoad(SoftPtr.ToSoftObjectPath(), OnBlueprintLoadedDelegate);\n}\n```\n\n\u003e [!WARNING]\n\u003e Don't use `FSoftClassPath`. Legacy code.\n\n---\n\n| Smart Pointer      | Type Based On      | Description                                                |\n|--------------------|--------------------|------------------------------------------------------------|\n| TSharedPtr         | Regular C++ Classes | Shared pointer for managing ownership of dynamically allocated objects. Allows multiple pointers to share ownership. |\n| TWeakPtr           | Regular C++ Classes | Weak pointer for non-owning references to dynamically allocated objects. |\n| TUniquePtr         | Regular C++ Classes | Unique pointer for exclusive ownership of dynamically allocated objects. Ensures only one pointer owns the object. |\n| TWeakObjectPtr     | UObject Classes    | Weak pointer for non-owning references to UObject-derived objects. |\n| TWeakInterfacePtr  | UObject Classes    | Weak pointer for non-owning references to objects implementing a specific interface. |\n| TSoftObjectPtr     | UObject Classes    | Soft pointer for non-owning references to UObject-derived objects. Allows loading the object when needed, but won't prevent it from being garbage collected. |\n| TSoftClassPtr      | UObject Classes    | Soft pointer for non-owning references to UClass-derived objects. Allows loading the class when needed, but won't prevent it from being garbage collected. |\n\n\u003c!-- prettier-ignore-end --\u003e\n\n### 🔖 Keywords\n\nIn C++, a keyword is a [reserved word](https://en.wikipedia.org/wiki/Reserved_word) that has a special meaning to the compiler. Keywords cannot be used as the names of variables, functions, or any other identifiers in your code.\n\nThe keywords in C++ are used to define the structure and behavior of your program. They are used to declare variables, functions, classes, and other types of identifiers. They also control the flow of execution of your program, such as with the `if`, `for`, and `switch` statements.\n\n#### Constants\n\n-   `const` - Specifies that an object or member is read-only and cannot be modified. Meaning, they are immutable.\n\n-   `constexpr` - Specifies that a function or member can be evaluated at compile-time. `constexpr` can be used for inlining variables, without using macros[^4]. **NOTE**, the compiler does not guarantee compile-time evaluation (only it **CAN** be evaluated at compile-time).\n\n-   `consteval` - Specifies that a function must be evaluated at compile-time. **NOTE**, it works only on functions and the compiler has to evaluated at compile-time.\n\n-   `constinit` - Specifies that a variable should be initialized only with constant expressions.\n\n```cpp\nint Add(const int\u0026 a, const int\u0026 b)\n{\n    a++; // Compiling error!\n    return a + b;\n}\n```\n\n```cpp\n// Will be compiled at runtime\nconst float PI = 3.14f;\n\n// Can be compiled at compile-time\nconstexpr double PI_DOUBLE = 3.14159265359;\n```\n\nYou can also use `constexpr` keyword for a function, which then can be directly used inside other operations as well (as it can be compiled at compile-time):\n\nWhat is the difference between a `constexpr` and macro then?\n\n\u003e A macro doesn't give you any protection against syntax incorrectness, nor any highlighting support for the code. Meaning, is more dangerous to track down bugs and issue, as well as maintaining the code. Therefore, it is more recommend to use `constexpr` keyword for members and functions, which will generated a \"truly\" constant value.\n\n```cpp\nconstexpr int getSizeOfAnArray()\n{\n    return 5;\n}\n\nint array[getSizeOfAnArray()]; // array has 5 elements\n```\n\n\u003e [!NOTE]\n\u003e If you want a \"truly\" constant value at compile-time with no expectations from the compiler, you can use `consteval` keyword instead. This forces the compiler to compile your code at compile-time.\n\n```cpp\nconsteval int getSizeOfAnArray()\n{\n    return 10;\n}\n\nint array[getSizeOfAnArray()]; // array has 10 elements\n\n// Will be compiled at compile-time\n// NOTE! It is also context-sensitive.\nconstinit int sizeOfAnArray = getSizeOfAnArray();\n```\n\n\u003e [!WARNING]\n\u003e The `consteval` and `constinit` keywords are only supported on C++ version 20. Meaning, if your compiler doesn't support, you can't use these keywords.\n\n\u003e [!NOTE]\n\u003e Unreal Engine is now supporting [C++ version 20](https://dev.epicgames.com/documentation/en-us/unreal-engine/epic-cplusplus-coding-standard-for-unreal-engine#modernc++languagesyntax:~:text=Unreal%20Engine%20compiles%20with%20a%20language%20version%20of%20C%2B%2B20%20by%20default%20and%20requires%20a%20minimum%20version%20of%20C%2B%2B17%20to%20build.).\n\n```cpp\n// Example of using constinit keyword\nstruct Data\n{\n    constinit const int i = 10;\n    constinit static int j = 20;\n};\n\nstatic_assert(Data::j == 20);\n```\n\nHere is a video, explaining what [constants keywords does in C++ by Cazz](https://www.youtube.com/watch?v=KBny6MZJR64)\n\n#### Access modifiers\n\n-   `public` - The member is accessible from any code that can see the class.\n-   `protected` - The member is accessible from the class in which it is declared, and from any derived classes.\n-   `private` - The member is only accessible from within the class where it is declared.\n\nHere's an example implementation of access modifiers:\n\n```cpp\nclass VehicleBase\n{\npublic:\n    int public_member = 10;\n\nprotected:\n    int protected_member = 20;\n\nprivate:\n    int private_member = 30;\n};\n\nclass Car : public VehicleBase\n{\n    public:\n        void Access()\n        {\n            std::cout \u003c\u003c \"public_member: \" \u003c\u003c public_member \u003c\u003c std::endl;\n            std::cout \u003c\u003c \"protected_member: \" \u003c\u003c protected_member \u003c\u003c std::endl;\n            std::cout \u003c\u003c \"private_member: \" \u003c\u003c private_member \u003c\u003c std::endl; // Will not compile\n        }\n};\n\nint main()\n{\n    VehicleBase vehicle;\n    std::cout \u003c\u003c \"public_member: \" \u003c\u003c vehicle.public_member \u003c\u003c std::endl;\n    std::cout \u003c\u003c \"protected_member: \" \u003c\u003c vehicle.protected_member \u003c\u003c std::endl; // Will not compile\n    std::cout \u003c\u003c \"private_member: \" \u003c\u003c vehicle.private_member \u003c\u003c std::endl; // Will not compile\n\n    Car car;\n    car.Access();\n\n    return 0;\n}\n\n```\n\n#### Class, struct and memory\n\n-   `class` and `struct` - Used to define user-defined types that encapsulate data and functions. In regular C++, both `class` and `struct` are both the same thing. Exposes `struct` exposes members are public by default.\n-   `new` - Allocates memory for an object (on the [heap memory](https://en.wikipedia.org/wiki/Memory_management#HEAP)) and calls its constructor.\n-   `delete` - Deallocates memory that was allocated with `new` keyword.\n\n```cpp\n/**\n * Struct to represent a person.\n */\nstruct Person\n{\n    /** The person's name. */\n    std::string name;\n\n    /** The person's age. */\n    int age;\n};\n\n// Allocate memory for a Person object and initialize its members.\nPerson* person = new Person;\nperson-\u003ename = \"John Doe\";\nperson-\u003eage = 30;\n\n// Print out the person's name and age.\nstd::cout \u003c\u003c \"Name: \" \u003c\u003c person-\u003ename \u003c\u003c std::endl;\nstd::cout \u003c\u003c \"Age: \" \u003c\u003c person-\u003eage \u003c\u003c std::endl;\n\n// Deallocate memory for the Person object.\ndelete person;\n```\n\n\u003e [!CAUTION]\n\u003e In Unreal Engine, it's recommended to use the built-in memory management functions like `NewObject()` and `MakeShared()` to allocate memory for objects, rather than using `new` and `delete`. Using `new` and `delete` can interfere with the garbage collector and cause memory leaks or crashes in your game.\n\nWhat is the difference between a class and struct then?\n\n\u003e In native C++, the main difference between a struct and a class is that struct members are public by default, whereas class members are private by default. However, this difference is largely syntactic, and struct and class can be used interchangeably to define custom types.\n\n\u003e However, Unreal Engine structs are used to represent data types that are typically used for data storage and manipulation, whereas classes are used to represent objects that have behavior and state.\n\n```cpp\n// Code here\n```\n\n#### Function related\n\n-   `virtual` - Specifies that a function should be polymorphic, meaning that it can be overridden by a derived class.\n-   `override` - Indicates that a function in a derived class is intended to override a function in the base class.\n-   `static` - Specifies that a variable or function is associated with a class rather than with a specific instance of the class.\n-   `inline` - Specifies that a function should be inlined (i.e., its code should be inserted directly into the calling code rather than calling the function).\n-   `force_inline` - Instructs the compiler to inline a function, regardless of whether it would normally do so.\n\n```cpp\n/**\n * @brief Struct used to store vehicle details.\n */\nstruct Details\n{\n    /**\n     * @brief Unique identifier for the vehicle.\n     */\n    int id;\n};\n\n/**\n * @brief Abstract base class for vehicles.\n */\nclass VehicleBase\n{\npublic:\n    /**\n     * @brief Honk the vehicle.\n     *\n     * This function should be implemented by derived classes to provide a way for\n     * the vehicle to make a noise.\n     */\n    virtual void Honk() = 0;\n\n    /**\n     * @brief Get the type of the vehicle.\n     *\n     * @return The type of the vehicle as a string.\n     */\n    virtual std::string GetVehicleType() = 0;\n\n    /**\n     * @brief Get the details of the vehicle.\n     *\n     * This function is a static member function and can be called without an\n     * instance of the class.\n     *\n     * @return The vehicle details.\n     */\n    static Details GetDetails()\n    {\n        return Details\n        {\n            id = 0\n        };\n    }\n};\n\n/**\n * @brief Class representing a car.\n */\nclass Car : public VehicleBase\n{\npublic:\n    /**\n     * @brief Overridden implementation of the Honk() function.\n     *\n     * This function calls the base implementation of Honk() and then does\n     * some additional work.\n     */\n    void Honk() override\n    {\n        // Calls the base function from the class's derived type.\n        VehicleBase::Honk();\n    }\n\n    /**\n     * @brief Overridden implementation of the GetVehicleType() function.\n     *\n     * This function returns a string representing the type of the vehicle.\n     *\n     * @return The type of the vehicle as a string.\n     */\n    std::string GetVehicleType() override\n    {\n        return \"Car\";\n    }\n};\n\n/**\n * @brief Class representing a bike.\n */\nclass Bike : public VehicleBase\n{\npublic:\n    /**\n     * @brief Overridden implementation of the Honk() function.\n     *\n     * This function does not call the base implementation of Honk() and\n     * therefore can overwrite the logic.\n     */\n    void Honk() override\n    {\n        // Does not call the base function, therefore can overwrite the logic.\n\n        // Some other code\n    }\n\n    /**\n     * @brief Overridden implementation of the GetVehicleType() function.\n     *\n     * This function returns a string representing the type of the vehicle.\n     *\n     * @return The type of the vehicle as a string.\n     */\n    std::string GetVehicleType() override\n    {\n        return \"Bike\";\n    }\n};\n\n// Static member function call\nDetails details = VehicleBase::GetDetails();\n```\n\n---\n\n\u003cfigure\u003e\n    \u003cblockquote\u003e\n        \u003cp\u003e“In theory, using inline functions can make your program faster because they eliminate the overhead associated with function calls. Calling a function requires pushing the return address on the stack, pushing arguments onto the stack, jumping to the function body, and then executing a return instruction when the function finishes. This process is eliminated by inlining the function. The compiler also has different opportunities to optimize functions expanded inline versus those that aren't. A tradeoff of inline functions is that the overall size of your program can increase.”\u003c/p\u003e\n    \u003c/blockquote\u003e\n    \u003cfigcaption\u003e\n        \u003ccite\u003e\n            \u003ca href=\"https://learn.microsoft.com/en-us/cpp/cpp/inline-functions-cpp\"\u003eMicrosoft docs\u003c/a\u003e\n        \u003c/cite\u003e\n    \u003c/figcaption\u003e\n\u003c/figure\u003e\n\nWhen inlining functions, you have the option to force or give the decision up to the compiler. By using `inline`, you are telling the compiler, that they are allowed to inline this function. However, it doesn't grant for an inline function.\n\nTo force an inline function, you must use `force_inline` keyword.\n\n\u003e [!NOTE]\n\u003e In Unreal Engine, it is more common to use a macro called `FORCEINLINE`, which is essentially expands to `force_inline` keyword.\n\n```cpp\ninline int CalcNewHealth(int Health)\n{\n    return Health - 10;\n}\n\nconst int Health = 10;\nHealth = CalcNewHealth(Health); // Compiles to: Health = 10 - 10;\n```\n\n#### Casts\n\n-   `dynamic_cast` - Performs a runtime check to determine whether an object can be cast to a different type.\n-   `static_cast` - Performs a static cast, which allows an expression to be converted to a different data type at compile time.\n-   `const_cast` - Performs a cast but removes the const from the variable, which it has been declared on.\n-   `reinterpret_cast` - Performs a cast that allows converting a pointer to any other type of pointer. Meaing, that this cast will allow you to reinterpretation of the bits representing the value without changing them.\n\n```cpp\n// Performs a runtime check to determine whether an object can be cast to a different type.\nParent* parentPtr = dynamic_cast\u003cParent*\u003e(childPtr); // NOTE! Must have asterisk inside the cast operation as well. Something that we don't need in Unreal Engine.\n\nif (parentPtr)\n{\n    // Casting successful, handle parentPtr\n}\nelse\n{\n    // Casting failed, handle accordingly\n}\n```\n\n```cpp\n// Performs a static cast, allowing an expression to be converted to a different data type at compile time.\nint num = 10;\ndouble result = static_cast\u003cdouble\u003e(num);\n```\n\n```cpp\n// Removes the const from a variable, which it has been declared on.\nconst int x = 5;\n\nint* y = const_cast\u003cint*\u003e(\u0026x);\n\n// Modifying the value of x through y\n*y = 10; // Will be changed to 10 instead 5.\n```\n\n```cpp\n// Converting a pointer to any other type of pointer, reinterpreting the bits representing the value without changing them.\nint* ptr = new int(65);\nchar* charPtr = reinterpret_cast\u003cchar*\u003e(ptr); // Will be casted to char pointer, with the value of 'A'.\n```\n\n\u003e [!CAUTION]\n\u003e Don't use C++ version of casts in Unreal Engine project. Instead, use `Cast()` provide by the engine. This cast is optimized for UE specific.\n\n\u003e [!NOTE]\n\u003e If you wish to use `static_cast()` in Unreal, then use `StaticCast()` provided by the engine. It will result in the same code, but fixes some issue with Visual Studio.\n\n```cpp\nACharacter* MyCharacter = GetPlayerCharacter();\n\n// This will perform a dynamic cast at runtime\nauto* MyActor = Cast\u003cAActor\u003e(MyCharacter);\n\n// Same as Cast\u003c\u003e, but will do a assertion (check) as well.\n// Meaning, if the cast was unsuccessful, then a crash will occur.\nauto* MyPlayer = CastChecked\u003cAPlayerCharacter\u003e(MyCharacter);\n```\n\n```cpp\n// This will perform either a static or dynamic cast\n// Which is compile either at compile-time or at runtime.\nint32 Value = StaticCast\u003cint32\u003e(3.14159265359);\n```\n\n#### Flow controls\n\n-   `if`, `else if` and `else` - Used for conditional execution in a program. `if` checks a condition and executes a block of code if the condition is true. `else if` provides an alternative condition to check if the first condition is false. `else` executes a block of code if none of the previous conditions are true.\n\n-   `switch` - A control flow statement used to select one of many code blocks to be executed based on the value of an expression.\n\n-   `for` - A loop statement that repeatedly executes a block of code as long as a condition is true. It consists of initialization, condition, and increment/decrement expression.\n\n-   `while` - Another loop statement that executes a block of code as long as a specified condition is true.\n\n-   `do` and `while` - Similar to the `while` loop, but the `do while` loop will execute the block of code at least once before checking the condition.\n\n-   `break` - Used to exit a loop or switch statement prematurely, transferring the program control to the statement immediately following the loop or switch.\n\n-   `continue` - Causes the program to skip the rest of the current iteration of a loop and proceed to the next iteration.\n\n-   `try`, `catch` and `finally` - Implements exception handling by trying a block of code that may throw an exception, catching the exception if it is thrown, and executing cleanup code in the `finally` block regardless of whether an exception is thrown or not.\n\n```cpp\nint num = 10;\n\nif (num \u003e 10)\n{\n    // do something\n}\nelse if (num \u003c 10)\n{\n    // do something else\n}\nelse\n{\n    // do something different\n}\n```\n\n```cpp\nint option = 2;\n\nswitch (option)\n{\n    case 1:\n        // case 1 actions\n        break;\n\n    case 2:\n        // case 2 actions\n        break;\n\n    default:\n        // default actions\n        break;\n}\n```\n\n```cpp\nfor (int i = 0; i \u003c 5; ++i)\n{\n    // loop body\n}\n```\n\n```cpp\nint i = 0;\n\nwhile (i \u003c 5)\n{\n    // loop body\n    ++i;\n}\n```\n\n```cpp\nint j = 0;\n\ndo\n{\n    // loop body\n    ++j;\n}\nwhile (j \u003c 5);\n```\n\n```cpp\nfor (int i = 0; i \u003c 10; ++i)\n{\n    if (i == 5)  break; // exits the loop when i equals 5\n\n    // loop body\n}\n```\n\n```cpp\nfor (int i = 0; i \u003c 5; ++i)\n{\n    if (i == 2)  continue; // skips the rest of the loop body for i equals 2\n\n    // loop body\n}\n```\n\n```cpp\ntry\n{\n    // block of code that may throw an exception\n    throw 20; // example of throwing an exception\n}\ncatch (int e)\n{\n    // handle exception\n    // e contains the thrown value\n}\nfinally\n{\n    // clean-up code that executes whether an exception is thrown or not\n}\n```\n\n#### Generic programming\n\n-   `template` - Allows generic programming by defining a type or function with parameters that are specified at compile time.\n\n```cpp\ntemplate \u003ctypename T\u003e\nvoid PrintArray(T* arr, size_t size)\n{\n    for (size_t i = 0; i \u003c size; ++i)\n        std::cout \u003c\u003c arr[i] \u003c\u003c \", \";\n\n    std::cout \u003c\u003c std::endl;\n}\n```\n\n```cpp\nint arr1[5] = { 1, 2, 3, 4, 5 };\ndouble arr2[5] = { 1.1, 2.2, 3.3, 4.4, 5.5 };\nstd::string arr3[5] = { \"one\", \"two\", \"three\", \"four\", \"five\" };\n\nPrintArray(arr1, sizeof(arr1) / sizeof(arr1[0])); // 1, 2, 3, 4, 5,\nPrintArray(arr2, sizeof(arr2) / sizeof(arr2[0])); // 1.1, 2.2, 3.3, 4.4, 5.5,\nPrintArray(arr3, sizeof(arr3) / sizeof(arr3[0])); // one, two, three, four, five,\n```\n\n#### Misc\n\n-   `auto` - Allows the compiler to deduce the type of a variable based on its initializer. Similar to C# version of `var` keyword.\n-   `namespace` - Defines a scope for identifiers to avoid naming conflicts.\n-   `operator` - Declares a function as an overloaded operator.\n-   `explicit` - Specifies that a constructor or conversion operator cannot be used for implicit type conversions.\n\n```cpp\nnamespace MyNamespace\n{\n    /**\n     * @brief This is an example class that shows how to use the `auto` keyword\n     * and overloaded operators.\n     */\n    class MyClass\n    {\n    public:\n        /**\n         * @brief Returns the current value of the class.\n         * @return The current value.\n         */\n        int GetValue() const { return value; }\n\n    private:\n        int value;\n\n    public:\n        /**\n         * @brief Adds the given number to the current value.\n         * @param number The number to add.\n         * @return The result of the addition.\n         */\n        int Add(const int\u0026 number)\n        {\n            // The compiler will figure out what type it should be\n            auto result = value + number;\n            return result;\n        }\n\n        /**\n         * @brief Updates the value of the class.\n         *\n         * This function is an example of bad practices.\n         * As the other developers who might read code,\n         * doesn't understand the return value type is.\n         */\n        void ExampleOfBadPractice()\n        {\n            auto result = Add(5);\n        }\n\n        /**\n         * @brief Overloaded `+` operator.\n         * @param other The number to add to the current value.\n         * @return A reference to the current object (to allow chaining).\n         */\n        void operator+(const int\u0026 other)\n        {\n            value = Add(other);\n        }\n    };\n}\n```\n\n\u003e [!TIP]\n\u003e It's recommended to `auto` keyword where a variable is declared twice during a single line. For an example, during a cast operation. If you use the `auto` keyword on a function return value, it can be extremely difficult for other developers to see what the return value type is.\n\n\u003e [!CAUTION]\n\u003e UHT[^2] doesn't support `operator` or `namespace` keyword. Meaning, you can't have a C++ class with a namespace, nor use the operations function for Blueprint.\n\n## 👷 Constructors, destructors and initialization\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n#### Constructors\n\nConstructors are special member functions in C++ that are automatically called when an object is created. They are used to initialize the object's data members and set up its initial state. Constructors have the same name as the class and can be overloaded to take different sets of parameters, allowing for object initialization in various ways.\n\nHere's an example:\n\n```cpp\n/**\n * This is a simple C++ class that demonstrates how to define a constructor.\n * Constructors are special member functions in C++ that are automatically\n * called when an object is created. They are used to initialize the object's\n * data members and set up its initial state.\n *\n * In Unreal Engine, you can define constructors and destructors in C++ classes\n * just like in standard C++. Constructors are useful for initializing\n * properties and setting up components when an object is created, while\n * destructors can be used for cleanup tasks like releasing resources or\n * stopping background processes when an object is destroyed.\n *\n * NOTE; Don't clean up UObject memory! As Unreal's garbage collector does this for you. Interfering with Unreal's GC can cause issue and even crashes.\n */\nclass RegularClass\n{\n    RegularClass()\n    {\n        // This constructor is called automatically,\n        // when an instance of RegularClass is created.\n\n        // It is used to initialize the object's data members,\n        // and set up its initial state.\n    }\n};\n```\n\n#### Destructors\n\nDestructors are another type of special member function in C++ that is automatically called when an object is destroyed or goes out of scope. They are used to perform cleanup tasks, release resources, and deallocate memory allocated during the object's lifetime. Like constructors, destructors have the same name as the class, preceded by a tilde (\u003ckbd\u003e~\u003c/kbd\u003e).\n\nHere's an example:\n\n```cpp\n/**\n * The destructor is a special member function in C++ that is automatically called\n * when an object is destroyed or goes out of scope. It is used to perform cleanup\n * tasks, release resources, and deallocate memory allocated during the object's\n * lifetime.\n *\n * In Unreal Engine, it is generally advised not to use destructors explicitly\n * for memory cleanup. Instead, Unreal Engine provides other mechanisms, such as\n * `BeginDestroy` and `EndPlay`, to handle object cleanup and resource release when\n * an object is destroyed or removed from the game world.\n */\nclass RegularClass\n{\npublic:\n\n    ~RegularClass()\n    {\n        // Destructor called when an instance of RegularClass is destroyed.\n        // Or goes out of scope (curly brackets).\n    }\n};\n```\n\n#### Constructors and destructors in UE\n\nIn Unreal Engine, you can define constructors and destructors in C++ classes just like in standard C++. Constructors are useful for initializing properties and setting up components when an object is created, while destructors can be used for cleanup tasks like releasing resources or stopping background processes when an object is destroyed.\n\nHowever, Unreal Engine has its own garbage collection system that automatically manages memory and deallocation of objects. This means that using destructors for memory deallocation or resource cleanup may interfere with the garbage collection process and lead to unexpected behavior or crashes.\n\nDue to the automatic garbage collection in Unreal Engine, it is generally advised not to use destructors explicitly for memory cleanup. Instead, Unreal Engine provides other mechanisms, such as `BeginDestroy` and `EndPlay`, to handle object cleanup and resource release when an object is destroyed or removed from the game world.\n\nHere's an example:\n\n```cpp\n#include \"MyActor.h\"\n\n#include \"GameFramework/Actor.h\"\n#include \"GameFramework/MovementComponent.h\"\n\nAMyActor::AMyActor()\n{\n    // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.\n    PrimaryActorTick.bCanEverTick = false;\n\n    // This is the default constructor for an Actor class in Unreal Engine.\n    // You can initialize properties and set up components here.\n\n    RootComponent = CreateDefaultSubobject\u003cUSceneComponent\u003e(\"SceneComponent\");\n\n    MeshComponent = CreateDefaultSubobject\u003cUStaticMeshComponent\u003e(TEXT(\"MeshComponent\"));\n    MeshComponent-\u003eSetupAttachment(RootComponent);\n    MeshComponent-\u003ebCastDynamicShadow = false;\n\n    checkf(MeshComponent, TEXT(\"MeshComponent cannot be a nullptr!\"));\n    verifyf(MeshComponent, TEXT(\"MeshComponent cannot be a nullptr!\"));\n    ensureMsgf(MeshComponent, TEXT(\"MeshComponent cannot be a nullptr!\"));\n\n    // Cast\u003cT\u003e has to be used for *UObjects* due to type safety; it will return *nullptr* in case of a failure in comparison with *StaticCast()*. StaticCast is just a wrapper to *static_cast* function.\n    if (UMovementComponent* MeshAsMovementComponent = Cast\u003cUMovementComponent\u003e(MeshComponent))\n    {\n        // Cast worked!\n\n        MeshAsMovementComponent-\u003ebSnapToPlaneAtStart = true;\n    }\n\n    UStaticMeshComponent* RootAsActorComponent = CastChecked\u003cUActorComponent\u003e(RootComponent); // Cast must work, otherwise a crash will occur.\n}\n\nvoid AMyActor::BeginPlay()\n{\n    Super::BeginPlay();\n\n    // This function is automatically called when the actor is spawned or added to the world.\n    // You can perform any necessary setup or initialization here.\n}\n\nvoid AMyActor::EndPlay(const EEndPlayReason::Type EndPlayReason)\n{\n    // This function is automatically called when the actor is removed from the world or destroyed.\n    // You can perform cleanup and resource release here.\n\n    Super::EndPlay(EndPlayReason);\n}\n```\n\n#### Initialization\n\nIn C++, initialization refers to the process of assigning an initial value to a variable when it is declared. Initialization is crucial because it ensures that variables have well-defined starting values, which can help avoid unexpected behavior and improve code clarity.\n\nHere's a code snippet that demonstrates:\n\n```cpp\n// Initialization using assignment statement\nint num1 = 10;\n\n// Initialization using brace initializer\nint num2{20};\n```\n\nThere is an **important** difference when using brace initializer, especially in cases where narrowing conversions are involved. A narrowing conversion occurs when a value is assigned to a variable that has a smaller range than the provided value. For example:\n\n```cpp\nint num3 = 1000;       // OK, no narrowing conversion\nint num4 = 1000.5;     // OK, narrowing conversion from double to int\nint num5{1000.5};      // Error, narrowing conversion from double to int\n```\n\nIn the last line, using brace initializer, the compiler will generate an error because it detects a narrowing conversion from `double` to `int`, which could potentially lead to data loss. This is a safety feature to help catch unintended data truncation.\n\n## 🏛 Create custom class\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/ActorLifeCycle.png\" alt=\"Lifecycle breakdown\" /\u003e\n    \u003cfigcaption\u003eLifecycle breakdown\u003c/figcaption\u003e\n\u003c/figure\u003e\n\nYou can read more about [Actor's lifecycle at Unreal's docs](https://docs.unrealengine.com/5.3/en-US/unreal-engine-actor-lifecycle/).\n\n### AActor\n\nBy inheriting from `AActor` class, you have these popular functions:\n\n```cpp\n/**\n * This function is called after the class's constructor, inside the Editor.\n * It's a safe way to initialize components inside the editor.\n */\nvoid PostInitComponents();\n\n/**\n * \"Awake/Start\" method\n *\n * This function is called when an actor is spawned or respawned.\n *\n * It's the perfect place to set up default values for your actor's\n * properties, initialize components, and start any asynchronous work\n * that needs to occur when the actor is first created.\n */\nvoid BeginPlay();\n\n/**\n * \"Update\" method\n *\n * This function is called every frame, with the time since the last\n * update as its parameter.\n *\n * Use this function to update your actor's state, like checking\n * whether it's colliding with something or not.\n *\n * NOTE; Try to avoid overusing Tick() function. Since, Unreal's core logic, is simply as runs for loop and calling each function for each lickable UObject. Which can be very expensive, with many and unnecessary update calls.\n * Here are some tips to overcome this issue:\n *      - Change your workflow to an event based driven system. Either by using delegates or single call functions.\n *      - Change your tick interval to a slower interval. If you require for UObject to tick, but don't require updating a single frame (then this is a perfect fit).\n *\n * @param DeltaTime Time since last update\n */\nvoid Tick(float DeltaTime);\n\n/**\n * \"Destroy\" method\n *\n * This function is called when an actor is destroyed, or when it's\n * forced to be destroyed (e.g. when its outermost `UWorld` is shut\n * down).\n *\n * It's a good place to clean up any resources that your actor\n * allocated during its lifetime. Like delegates (NOTE; some delegates are bind directly to UObject and don't require to unbind directly).\n */\nvoid EndPlay();\n\n/**\n * Returns the location of the RootComponent of this Actor\n *\n * @return Location of the RootComponent\n */\nFVector GetActorLocation() const;\n\n/**\n * Returns the rotation of the RootComponent of this Actor\n *\n * @return Rotation of the RootComponent\n */\nFRotator GetActorRotation() const;\n\n/**\n * Returns the Actor's world-space scale.\n *\n * @return The world-space scale of the actor\n */\nFVector GetActorScale3D() const;\n\n/**\n * Getter for the cached world pointer, will return null if the actor is not actually spawned in a level\n *\n * @return The world pointer\n */\nUWorld* GetWorld() const;\n\n/**\n * Get the owner of this Actor, used primarily for network replication.\n *\n * @return The owner of this Actor\n */\nAActor* GetOwner() const;\n\n/**\n * Find all Actors which are attached directly to a component in this actor\n *\n * @param[out] OutActors       The array to fill with the attached actors\n * @param bResetArray          Whether to reset the array before adding new Actors\n * @param bRecursivelyIncludeAttachedActors Whether to include attached actors of attached actors also\n */\nvoid GetAttachedActors(TArray\u003cAActor*\u003e\u0026 OutActors, bool bResetArray = true, bool bRecursivelyIncludeAttachedActors = false) const;\n\n/**\n * Get all components derived from specified ComponentClass and fill in the OutComponents array with the result.\n *\n * @tparam AllocatorType       The allocator type to use for OutComponents\n * @tparam ComponentType       The type of the components to get\n * @param ComponentClass       The class of the components to get\n * @param[out] OutComponents  The array to fill with the found components\n * @param bIncludeFromChildActors Whether to include components from Child Actors also\n */\ntemplate\u003cclass AllocatorType, class ComponentType\u003e\nvoid GetComponents(TSubclassOf\u003cUActorComponent\u003e ComponentClass, TArray\u003cComponentType*, AllocatorType\u003e\u0026 OutComponents, bool bIncludeFromChildActors = false) const;\n\n/**\n * Searches components array and returns first encountered component of the specified class\n *\n * @param ComponentClass    The class of the component to search for\n * @return The found component or nullptr if not found\n */\nUActorComponent* GetComponentByClass(TSubclassOf\u003cUActorComponent\u003e ComponentClass) const;\n```\n\n### UActorComponent\n\nBy inheriting from `UActorComponent` class, you have these popular functions:\n\n```cpp\n/**\n * Returns the owner of this component\n *\n * @return Owner of this component\n */\nUObject* GetOwner() const;\n\n/**\n * Returns the SceneComponent this component is attached to, or nullptr if not attached.\n *\n * @return The SceneComponent this component is attached to, or nullptr if not attached\n */\nUWorld* GetWorld() const;\n\n/**\n * Returns whether the component is active or not\n */\nbool IsActive() const;\n\n/**\n * Returns whether this component has tick enabled or not\n */\nbool IsComponentTickEnabled() const;\n\n/**\n * Activates the SceneComponent, should be overridden by native child classes.\n *\n * @param bReset If true, reset the component before activating it\n */\nvoid Activate(bool bReset);\n\n/**\n * Deactivates the SceneComponent.\n */\nvoid Deactivate();\n\n/**\n * Set this component's tick functions to be enabled or disabled.\n *\n * @param bEnabled If true, enable the tick functions, otherwise disable\n */\nvoid SetComponentTickEnabled(bool bEnabled);\n\n/**\n * Sets the tick interval for this component's primary tick function.\n *\n * @param TickInterval The tick interval in seconds\n */\nvoid SetComponentTickInterval(float TickInterval);\n\n/**\n * Function called every frame on this ActorComponent.\n *\n * @param DeltaTime The time since the last frame in seconds\n * @param TickType The kind of tick this is (LEVELTICK_All, LEVELTICK_Editor, LEVELTICK_TimeOnly)\n * @param ThisTickFunction Pointer to the original function that is being called\n */\nvoid TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction);\n```\n\n### USceneComponent\n\nBy inheriting from `USceneComponent` class, you have these popular functions:\n\n```cpp\n/**\n * Returns the SceneComponent this component is attached to, or nullptr if not attached.\n *\n * @return The SceneComponent this component is attached to, or nullptr if not attached\n */\nUSceneComponent* GetAttachmentRoot() const;\n\n/**\n * Detaches this component from its parent component.\n *\n * @param bMaintainWorldTransform Whether to maintain the world transform of this component\n */\nvoid DetachFromComponent(bool bMaintainWorldTransform = false);\n\n/**\n * Attaches this component to the supplied parent component.\n *\n * @param Parent                The component to attach to\n * @param SocketName            If the parent is a USkeletalMeshComponent, this is the name of the socket to attach to\n * @param AttachLocation        The location in world space to attach this component\n */\nvoid AttachToComponent(USceneComponent* Parent, FName SocketName = NAME_None, const FAttachmentTransformRules\u0026 AttachRules = AttachmentTransformRules::KeepRelativeTransform);\n\n/**\n * Attaches this component to the supplied parent component.\n *\n * @param Parent                The component to attach to\n * @param AttachLocation        The location in world space to attach this component\n */\nvoid AttachToComponent(USceneComponent* Parent, const FTransform\u0026 AttachLocation, const FAttachmentTransformRules\u0026 AttachRules  FAttachmentTransformRules::KeepRelativeTransform);\n\n/**\n * Attaches this component to the supplied parent component.\n *\n * @param Parent                The component to attach to\n */\nvoid AttachTo(USceneComponent* Parent);\n\n/**\n * Attaches this component to the supplied parent component.\n *\n * @param Parent                The component to attach to\n */\nvoid AttachTo(AActor* Parent);\n\n/**\n * Attaches this component to the supplied parent component.\n *\n * @param Parent                The component to attach to\n */\nvoid AttachToComponent(UActorComponent* Parent, const FAttachmentTransformRules\u0026 AttachRules = AttachmentTransformRules::KeepRelativeTransform);\n\n/**\n * Attaches this component to the supplied parent component.\n *\n * @param Parent                The component to attach to\n */\nvoid AttachToComponent(UActorComponent* Parent, const FTransform\u0026 AttachLocation, const FAttachmentTransformRules\u0026 AttachRules  FAttachmentTransformRules::KeepRelativeTransform);\n\n/**\n * Attaches this component to the supplied parent component.\n *\n * @param Parent                The component to attach to\n */\nvoid AttachTo(UActorComponent* Parent);\n\n/**\n * Returns true if this component is currently attached to the supplied component\n *\n * @param InComponent           The component to check against\n * @return                      true if this component is currently attached to InComponent\n */\nbool IsAttachedTo(const USceneComponent* InComponent) const;\n\n/**\n * Returns true if this component is currently attached to the supplied component\n *\n * @param InComponent           The component to check against\n * @return                      true if this component is currently attached to InComponent\n */\nbool IsAttachedTo(const UActorComponent* InComponent) const;\n\n/**\n * Returns the Component to World transform, calculated from this component's AttachmentTransform,\n * unless overridden by any parents.\n */\nconst FTransform\u0026 GetComponentToWorld() const;\n\n/**\n * Returns the Component to World transform, calculated from this component's AttachmentTransform,\n * unless overridden by any parents.\n */\nFTransform CalcNewComponentToWorld(const FTransform\u0026 NewAttachmentTransform) const;\n```\n\n### APawn\n\nBy inheriting from `APawn` class, you have these popular functions:\n\n```cpp\n\n/**\n * Add movement input along the given world direction vector (usually normalized) scaled by 'ScaleValue'.\n *\n * This function is used to control movement of an actor without using physics or movement components.\n * For example, it can be used to move a character in a top-down game.\n *\n * @param WorldDirection Direction vector (in world space) in which movement is input.\n * @param ScaleValue Scale value for the input.\n * @param bForce If `true`, forces the input to be applied even if the component is not moving.\n */\nvoid AddMovementInput(FVector WorldDirection, float ScaleValue, bool bForce);\n\n/**\n * Add input (affecting Yaw) to the Controller's ControlRotation, if it is a local PlayerController.\n *\n * This function is used to control rotation of an actor without using a camera component.\n * For example, it can be used to rotate a character in a first-person shooter game.\n *\n * @param Val Input value (affecting Yaw) to be applied to the Controller's ControlRotation.\n */\nvoid AddControllerYawInput(float Val);\n\n/**\n * Add input (affecting Pitch) to the Controller's ControlRotation, if it is a local PlayerController.\n *\n * This function is used to control rotation of an actor without using a camera component.\n * For example, it can be used to rotate a character in a first-person shooter game.\n *\n * @param Val Input value (affecting Pitch) to be applied to the Controller's ControlRotation.\n */\nvoid AddControllerPitchInput(float Val);\n\n/**\n * Add input (affecting Roll) to the Controller's ControlRotation, if it is a local PlayerController.\n *\n * This function is used to control rotation of an actor without using a camera component.\n * For example, it can be used to rotate a character in a first-person shooter game.\n *\n * @param Val Input value (affecting Roll) to be applied to the Controller's ControlRotation.\n */\nvoid AddControllerRollInput(float Val);\n\n/**\n * Returns velocity (in cm/s (Unreal Units/second) of the rootcomponent if it is either using physics or has an associated ovementComponent\n *\n * This function is used to get the current velocity of an actor.\n *\n * @return Current velocity of the actor's root component (in cm/s (Unreal Units/second) or (0, 0, 0) if it doesn't have any ovement components.\n */\nFVector GetVelocity();\n```\n\n### UObject\n\nBy inheriting from `UObject` class, you have these popular functions:\n\n```cpp\n/**\n * Returns the name of this object (with no path information)\n *\n * Name of the object.\n *\n * @return Name of the object (with no path information).\n */\nFString GetName() const;\n\n/**\n * Returns the UClass that defines the fields of this object\n *\n * @return UClass that defines the fields of this object.\n */\nUClass* GetClass();\n\n/**\n * Returns the UObject this object resides in (e.g. parent object)\n *\n * @return UObject this object resides in (e.g. parent object).\n */\nUObject* GetOuter();\n\n/**\n * Checks to see if the object appears to be valid\n *\n * @return true if the object appears to be valid, false otherwise.\n */\nbool IsValidLowLevel();\n\n/**\n * Returns true if this object is of the specified type.\n *\n * @param SomeBase The class to check this object against.\n * @return true if this object is of the specified type, false otherwise.\n */\ntemplate\u003ctypename OtherClassType\u003e\nbool IsA(OtherClassType SomeBase) const;\n```\n\n\u003c!-- prettier-ignore-start --\u003e\n\n## 🏛 Create custom interface\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nInterface are very useful for handling functions in a generic way. It allows you to create a contract with specified functions, which a programmer can extend on top of a specified class.\n\nFor an example, IVehicle can contain functions such as `Honk()` or `StallEngine()`. However, these functions can be implemented in a range of classes. Such as `ACarPawn` or `ABoatPawn`.\n\nWhen calling the interface function in C++, Unreal will check if the type extends the interface. If not, the call gets skipped. This allows you to call the interface function on `UObject` and is not limited to only types of `ACarPawn` or `ABoatPawn`.\n\nThis also allows you to extend the interface inside Blueprint instead. For an example, you don't have to create the interface logic inside C++, but rather create the logic at Blueprint level instead.\n\nYou can read more about interfaces, at [Unreal's docs](https://dev.epicgames.com/documentation/en-us/unreal-engine/interfaces-in-unreal-engine).\n\n### Creating interface inside C++\n\nHere's a template file for creating an interface inside C++:\n\n```cpp\n// IVehicle.h\n\n#pragma once\n\n#include \"CoreMinimal.h\"\n#include \"UObject/Interface.h\"\n#include \"IVehicle.generated.h\"\n\n/*\nThis class does not need to be modified.\nEmpty class for reflection system visibility.\nUses the UINTERFACE macro.\nInherits from UInterface.\n*/\nUINTERFACE(MinimalAPI, Blueprintable)\nclass UVehicle : public UInterface\n{\n    GENERATED_BODY()\n};\n\n/* Actual Interface declaration. */\nclass IVehicle\n{\n    GENERATED_BODY()\n\n    // Add interface functions to this class. This is the class that will be inherited to implement this interface.\n\npublic:\n    // Add interface function declarations here\n\n    // BlueprintNativeEvent - Allows you to overwrite the function in either C++ or Blueprint\n    // BlueprintImplementableEvent - Allows the function to only be overwritten in Blueprint\n\n    UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = \"Vehicle\")\n    void Honk();\n\n    UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = \"Vehicle\")\n    void StallEngine();\n\n    UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = \"Vehicle\")\n    void Explode(bool bForce = true);\n};\n```\n\n\u003e [!WARNING]\n\u003e `BlueprintNativeEvent` allows you to overwrite the function in either C++ or Blueprint, but if you use `BlueprintImplementableEvent` it only allows the function to only be overwritten in Blueprint.\n\n### Extending the interface function:\n\nWhen adding an interface class to a C++ class, you must use the suffix of `_Implementation` for all the functions that you are overwriting. Otherwise, UHT[^2] will not recognize the function.\n\nHere's an example, of extending the interface functions inside C++:\n\n```cpp\n// ACarPawn.h\n\n#include \"CoreMinimal.h\"\n#include \"GameFramework/Pawn.h\"\n#include \"IVehicle.h\" // Include the interface's header\n#include \"CarPawn.generated.h\"\n\nUCLASS()\nclass ACarPawn : public APawn, public IVehicle\n{\nprotected:\n    void Honk_Implementation();\n    void StallEngine_Implementation();\n    void Explode_Implementation(bool bForce);\n};\n```\n\n```cpp\n// ACarPawn.cpp\n\nvoid ACarPawn::Honk_Implementation()\n{\n    // Add code here...\n}\n\nvoid ACarPawn::StallEngine_Implementation()\n{\n    // Add code here...\n}\n\nvoid ACarPawn::Explode_Implementation(bool bForce)\n{\n    // Add code here...\n}\n```\n\n### Calling the interface function\n\nWhen calling the interface function inside C++, you are required to call the function with a prefix of `Execute`. If you don't use the prefix, you will get a warning from Unreal Engine.\n\n\u003e [!NOTE]\n\u003e You are calling the interface function from the interface itself. Meaning, instead of `ACarPawn-\u003eExplode()`, which is an interface function. You must call the function as: `IVehicle::Execute_Explode()` instead. With the parameter being on what object you want the interface function to be called on.\n\n```cpp\nUObject* CarObject = nullptr; // The UObject, that you wish to call the function on.\nconst bool bForce = true; // Parameters\n\n// The syntax for calling the interface function\nIVehicle::Execute_Explode(CarObject, bForce);\n```\n\n### Checking if the UObject extends the interface\n\nSometimes, you must check if the `UObject` has the interface class attach to it. You can either do by calling `Implements()` function, which returns a boolean. Or you can do a cast operation. The cast will return `nullptr`, if the operation failed.\n\n```cpp\nUObject* CarObject = nullptr; // The UObject, that you wish to call the function on.\n\nbool bIsImplemented = CarObject-\u003eImplements\u003cIVehicle\u003e();\n```\n\nA longer version of `Implements()` function:\n\n```cpp\nUObject* CarObject = nullptr; // The UObject, that you wish to call the function on.\n\nbool bIsImplemented = CarObject-\u003eGetClass()-\u003eImplementsInterface(UVehicle::StaticClass());\n```\n\nAnd here is the cast version:\n\n```cpp\nUObject* CarObject = nullptr; // The UObject, that you wish to call the function on.\n\nIVehicle* VehiclePtr = Cast\u003cIVehicle\u003e(CarObject);\n```\n\n\u003e [!CAUTION]\n\u003e The `Cast\u003c\u003e` method only works, if the interface is implemented in a C++ class. If the interface was instead implemented in Blueprint, then the cast will return `nullptr`. You can use `TScriptInterface\u003c\u003e` to safely copy an interface pointer. In alternative, you have the weak interface pointer (`TWeakInterfacePtr`).\n\n### Reference to an interface object\n\nIf you wish to reference an interface object, and you want safety grantee for both Blueprint and C++, then must you `TScriptInterface\u003c\u003e`.\n\n```cpp\nvoid DestroyVehicle(const TScriptInterface\u003cIVehicle\u003e\u0026 Vehicle)\n{\n    const bool bForce = true;\n    IVehicle::Execute_Explode(Vehicle.GetObject(), bForce);\n}\n```\n\nHowever, if you tend to use the interface pointer inside C++, you can either use a regular raw pointer to the interface.\n\n```cpp\nUObject* CarObject = nullptr; // The UObject, that you wish to call the function on.\n\nIVehicle* VehiclePtr = Cast\u003cIVehicle\u003e(CarObject);\n```\n\nOr use a weak pointer (`TWeakInterfacePtr`). Note, that this pointer is weak. Meaning, the weak pointer will not prevent destruction of the object it references.\n\n```cpp\nTWeakInterfacePtr\u003cIVehicle\u003e VehiclePtr; // Weak pointer to the interface.\nUObject* CarObject = nullptr; // The UObject, that you wish to call the function on.\n\nVehiclePtr = Cast\u003cIVehicle\u003e(CarObject);\n\nif (VehiclePtr.IsValid())\n{\n    // Check if the pointer is valid\n}\n```\n\nFor more information on weak pointers, you can read at [💾 Soft vs hard references](#-soft-vs-hard-references).\n\n\u003e [!TIP]\n\u003e `TScriptInterface` inside Blueprint is nicer to look at, than C++ version.\n\n\u003c!-- prettier-ignore-end --\u003e\n\n## 🛸 Reflection System\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nUnreal Engine's reflection system is a powerful feature that allows objects and their properties to be accessed and modified at runtime. The reflection system works by storing information about each class and its members, such as properties and functions, in metadata that can be accessed at runtime. This metadata is generated automatically by the Unreal Header Tool (UHT[^2]) during compilation. With the help of `GENERATED_BODY()` macro and `[FileName].generated.h` header.\n\nThe generated header file is typically included in the source file that defines the corresponding class or struct, and it is also included in any other source files that use that class or struct. This ensures that the metadata is available to the engine at compile-time and runtime.\n\nThe reflection system is also used in many other areas of the engine, such as serialization and networking. When objects are saved to disk or sent over the network, their properties are serialized into a binary format. The reflection system is used to determine which properties to serialize, and how to convert them to and from their binary representation.\n\nOne of the key benefits of the header system is that it allows for very efficient compilation times. Because each C++ file has its own header file, changes to one file do not require recompilation of other files that depend on it. Instead, only the files that include the modified header file need to be recompiled.\n\nYou can read more about [reflection system from their docs](https://docs.unrealengine.com/5.0/en-US/reflection-system-in-unreal-engine/).\n\n\u003c!-- prettier-ignore-start --\u003e\n\n## 🗑️ Garbage Collection\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nGarbage Collection is an automatic memory management feature used in modern languages like C#[^12], Python[^11], and Javascript[^14], which automatically removes objects from memory when they are no longer in use.\n\nIn a garbage-collected environment, you can create objects, use them, and then set the variable pointing to them as null when done, and the garbage collector takes care of freeing up the memory. Unlike lower-level languages like C[^10] and C++, which require manual memory management, Unreal Engine has its own Garbage Collection system to simplify memory management for developers.\n\nYou can read more about [Stack vs Heap](#-stack-vs-heap) section. Which tells more about how the memory is management in programming languages.\n\nYou can also read more about [Unreal Object Handling on their docs](https://docs.unrealengine.com/5.2/en-US/unreal-object-handling-in-unreal-engine/).\n\n### How does it work\n\nWhen you create a UObject-derived object in Unreal Engine, it becomes part of the garbage collection system, which automatically identifies and removes unused objects every 30-60 seconds or as needed based on system memory. The garbage collection system maintains a \"Root Set\" of objects that should always be kept alive, and it uses reflection to trace object references and ensure objects are reachable. Objects outside the Root Set and not reachable are marked for garbage collection, and their memory is freed.\n\nBy properly using UE's decorators, you can avoid issues with dangling pointers and crashes caused by accessing garbage-collected objects.\n\n#### Rules\n\nEvery member of a class should be declared as a `UPROPERTY`\n\u003e If an member is left “naked,” unreal will not know about it. So, an object you are pointing at could get deleted out from under you! It is safe to leave value types such as an `int` or a `bool` “naked” although they could not be saved, replicated, or appear in the editor.\n\nMember pointers should only point at `UObject` or UObject-derived objects\n\u003e The garbage collector is only smart enough to recognize relationships to an object, so the object could get deleted out from under your pointer.\n\nAny non-UObject pointer must be pointing to something “global” in the engine, or something within its own `UObject`\n\u003e The garbage collector could delete the object that owns what you are pointing at.\n\n\u003e [!WARNING]\n\u003e For the garbage collector to do its work of determining what is safe to delete (for a container), it must traverse every field of every object. While Unreal provides several types of containers (`TArray`, `TMap`, …) the garbage collector only considers pointers in `TArray`.\n\n#### Examples\n\n```cpp\nUPROPERTY()\nTArray\u003cUWidget*\u003e LotsOfWidgets;\n\nTMap\u003cint, TWeakObjectPtr\u003cUWidget\u003e\u003e LotsOfWeakWidgets;\n```\n\n### Manual memory management\n\nUObjects should never be created with `new`, but only with the default creation methods (`NewObject()`, `SpawnActor()`, `CreateDefaultSubobject()`).\n\n### Collection and Mark as garbage\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\nConditions\n\n* By having a strong reference (`UPROPERTY`) to them (from objects that are also referenced)\n\n* By calling `UObject::AddReferencedObjects()` (from objects that are also referenced)\n\n* By adding them to the root set with `UObject::AddToRoot()` (typically unnecessary)\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nWhen objects do not fulfill any of the above conditions, on the next GC cycle they will be marked as unreachable and garbage collected (destroyed).\n\nTo force the destruction of objects that are still reachable, you can call `UObjectBaseUtility::MarkAsGarbage()` on them, and it will force their destruction on the next GC cycle (you generally want to avoid doing this, as that is what garbage collection is for, and some classes, like `AActor` and `UActorComponent` do not directly support it).\n\nThe destruction of an object doesn't necessarily all happen in the same frame, when garbage collection starts on it, it will first call `BeginDestroy()` (do not call this yourself), then, when ready `FinishDestroy()`.\n\n\u003e [!NOTE]\n\u003e Raw pointers declared with `UPROPERTY`, will be set to `nullptr`\n\n### Validation\n\nWhenever code references an `AActor` or a `UActorComponent`, it has to deal with the possibility that `AActor::Destroy()` could be called on the actor or `UActorComponent::DestroyComponent()` could be called on the component. These functions will mark them for pending kill, thus triggering their garbage collection at the first opportunity (note that destroying an actor also destroys all its components).\n\nSince the garbage collector automatically nulls out `UPROPERTY` pointers when it actually gets to destroy them, null-checking an actor or component pointer is sufficient to know it's safe to use, though you might also want to check `IsPendingKill()` on them (through `IsValid()`) to avoid accessing them after they have been marked for destruction (`TWeakObjectPtr` already checks for this when retrieving the raw pointer).\n\n```cpp\nbool IsValid(const UObject* Test);\n```\n\nGlobal function that automatically checks if an object pointer is non-null and not pending kill.\n\n```cpp\nUObjectBase::IsValidLowLevel();\nUObjectBase::IsValidLowLevelFast();\n```\n\nShould not be used for Garbage Collection checks, as on `UPROPERTY` pointers it will always return true, while on raw pointer it will return true or false depending on whether the object had already been destroyed, but in the latter case it's also likely to also crash the application as the pointed memory could have been overwritten.\n\n\u003c!-- prettier-ignore-end --\u003e\n\n## 💾 Soft vs hard references\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n![Soft vs hard references](static/img/Soft_Hard_Refs.png)\n\n### Soft References\n\nA soft reference is a weak reference to an asset that does not create a strong dependency. It allows assets to be loaded or unloaded dynamically at runtime based on usage or other conditions. Soft references are used when you want to indicate a loose dependency on an asset without forcing its loading.\n\nAn analogy for a soft reference could be a bookmark in a book. It points to a specific page but doesn't physically hold the content. You can easily remove or change the bookmark without affecting the book's content.\n\n### Hard References\n\nA hard reference is a strong reference to an asset that creates a firm dependency. It ensures that the referenced asset is loaded and remains loaded as long as the referencing asset is in use. Hard references are used when you require a guaranteed presence of an asset during runtime.\n\nAn analogy for a hard reference could be a puzzle piece that needs to fit into a specific spot. The puzzle piece is integral to the puzzle, and removing or changing it would break the intended structure.\n\n---\n\nWhen an asset with hard references is loaded, it triggers a chain of dependencies, causing all assets that have hard references to be loaded as well. This ensures that all required assets are available for proper functionality. This loading behavior is known as \"chain loading\" or \"load-on-demand.\"\n\nFor example, if a level blueprint references a specific sound cue with a hard reference, when the level is loaded, the sound cue and any other assets directly or indirectly referenced by it will also be loaded to maintain the integrity of the referenced sound cue's functionality.\n\nIn contrast, if a soft reference is used, the referenced asset may or may not be loaded initially, and it can be loaded or unloaded dynamically based on the specific requirements of the game or application.\n\nUsing the appropriate combination of soft and hard references allows for efficient management of asset dependencies, optimizing memory usage, and providing flexibility in loading and unloading assets during runtime.\n\n[Reference Viewer](https://docs.unrealengine.com/5.2/en-US/finding-asset-references-in-unreal-engine/) is a tool inside the editor, which allows you to look at the reference chain with a particular asset. Both hard and soft references. This tool helps you to figure it out which is loading which and what chain dependencies it has.\n\n[Size Map](https://dev.epicgames.com/community/learning/tutorials/r4y7/unreal-engine-size-map) is another tool inside the editor, which allows you to look at the total and independent size of different assets, which has been loaded by the main asset. For example, you can see how big the character [memory footprint](https://en.wikipedia.org/wiki/Memory_footprint) is (with all the textures and skeletal mesh).\n\nYou can read more about soft and hard references in article called [Hard References \u0026 Reasons to Avoid Them by raharuu](https://raharuu.github.io/unreal/hard-references-reasons-avoid/).\n\nYou can also read more about Unreal Engine docs about [Referencing Assets](https://docs.unrealengine.com/5.2/en-US/referencing-assets-in-unreal-engine/).\n\n## 🌍 Global Functions\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nGlobal functions are functions that are defined outside of any class and are not tied to any specific object instance. They are accessible from any part of the codebase and can be used to perform tasks or calculations that do not require access to specific object properties or methods.\n\nGlobal functions in Unreal Engine are commonly used for utility functions, helper functions, or functions that operate on data independently of any particular object instance.\n\n-   `IsValid()`: Check if a pointer or object reference is valid. This is important to avoid accessing or modifying null pointers, which can cause crashes or other unexpected behavior.\n\n-   `Swap()`: Swaps the contents of two `TObjectPtr` objects.\n\n-   `Exchange()`: Exchanges the contents of a `TObjectPtr` with a new object, returning the previous object.\n\n-   `MakeWeakObjectPtr()`: Creates a weak pointer (`TWeakObjectPtr`) from a `TObjectPtr`, allowing for non-owning references to the object.\n\n-   `Cast()`: Dynamically cast to another object. If the cast object is not of the specified type, it will return a nullptr. If the object is of the specified type or a subclass of it, the function will return a pointer to the object cast to the specified type.\n\n-   `CastChecked()`: Similar to `Cast()`, but it also performs a runtime check in debug builds to ensure that the object is of the specified type. If the check fails, it will trigger an assertion. This function is useful when you are certain that an object should be of a particular type and want to catch errors early in development.\n\n-   `StaticCast()`: Tries to cast at compile-time. However, some code might only work at runtime, therefore the compiler will decide if static cast is \"appropriate\" to do so.\n\n\u003e [!NOTE]\n\u003e The `StaticCast()` function is just forwarding the built-in cast operation from C++, which is called `static_cast()`. Which means, there is no saftey garunete with Unreal Engine `UObject`s.\n\n## 🏛️ Libraries\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nBlueprint Function Libraries (`UBlueprintFunctionLibrary`) are a collection of static functions that provide utility functionality not tied to a particular gameplay object. These libraries can be grouped into logical function sets, e.g. AI Blueprint Library, or contain utility functions that provide access to many different functional areas, e.g. System Blueprint Library.\n\n```cpp\nUCLASS()\nclass UAnalyticsBlueprintLibrary : public UBlueprintFunctionLibrary\n{\n    GENERATED_UCLASS_BODY()\n\npublic:\n    /** Starts an analytics session without any custom attributes specified */\n    UFUNCTION(BlueprintCallable, Category = \"Analytics\")\n    static bool StartSession();\n}\n```\n\nAs you can see in the example above, a Blueprint Function Library is indirectly a `UObject` derived and therefore requires the standard `UCLASS()` and `GENERATED_UCLASS_BODY()` macros[^4]. It decorates the functions that are to be callable from Blueprints with the `UFUNCTION()` macro[^4]. Functions in a Blueprint Function Library can be designated as BlueprintCallable or BlueprintPure depending on whether the calls have side effects or not.\n\nBelow is the implementation of the `StartSession()` function:\n\n```cpp\nbool UAnalyticsBlueprintLibrary::StartSession()\n{\n    TSharedPtr\u003cIAnalyticsProvider\u003e Provider = FAnalytics::Get().GetDefaultConfiguredProvider();\n\n    if (Provider.IsValid())\n        return Provider-\u003eStartSession();\n    else\n    {\n        UE_LOG(\n            LogAnalyticsBPLib,\n            Warning,\n            TEXT(\"StartSession: Failed to get the default analytics provider. Double check your [Analytics] configuration in your INI\")\n        );\n    }\n\n    return false;\n}\n```\n\nYou can read more about [Blueprint Function Libraries here](https://docs.unrealengine.com/5.2/en-US/blueprint-function-libraries-in-unreal-engine/)!\n\n### Kismet Library\n\n* `UGameplayStatics` - `gameplay` utility functions that can be called from both Blueprint and C++\n* `UKismetMathLibrary` - `math` utility functions that can be called from both Blueprint and C++\n* `UKismetStringLibrary` - `string` utility functions that can be called from both Blueprint and C++\n* `UKismetTextLibrary` - `text` utility functions that can be called from both Blueprint and C++\n* `UKismetSystemLibrary` - `system` utility functions that can be called from both Blueprint and C++\n* `UKismetMaterialLibrary` - `material` utility functions that can be called from both Blueprint and C++\n* `UKismetInputLibrary` - `input` utility functions that can be called from both Blueprint and C++\n* `UKismetGuidLibrary` - `guid` utility functions that can be called from both Blueprint and C++\n* `UKismetArrayLibrary` - `array` utility functions that can be called from both Blueprint and C++\n\n### Misc Library\n\n* `FMath` - Math helper functions (Check `GenericPlatformMath.h` for additional math functions).\n* `DrawDebugHelpers.h` - Header file contain debug draw functions. Read more about [here](https://unrealcpp.com/draw-debug-helpers/).\n\n## 📃 Macros\n\nMacros[^4] are preprocessor directives that perform text replacements before the compilation process. They are denoted by the \u003ckbd\u003e#\u003c/kbd\u003e symbol and are used to define reusable code snippets, conditionally include or exclude code, and perform other preprocessing operations.\n\nCreating a macro in C++ with Unreal Engine is straightforward. You can use the #define preprocessor directive to define a macro. Here's the basic syntax:\n\n```cpp\n#define MACRO_NAME(value) // Macro definition\n```\n\nHere's an example of PI macro:\n\n```cpp\n#define PI 3.14\n#define PI_MULTIPLY(x) 3.14 * x\n```\n\nHere is a list of common macros in Unreal Engine:\n\n-   `GENERATED_BODY()` - Boilerplate code required by the engine.\n\n-   `TEXT()` - Used for specifying wide-character (UTF-16) encoding. This makes the string literal for being platform independent. Without this macro, you are using ANSI encoding (which can cause issue on other machines).\n-   `TEXTVIEW()` - Calculates the length of a string from a string literal at compile time.\n-   `INVTEXT()` - Mark text strings for localization. It stands for \"Invariant Text\" and is used to specify text that should remain unchanged during the localization process.\n-   `LOCTEXT()` - Creating localized text. It stands for \"Localized Text\" and allows you to define text literals that can be localized for different languages.\n\n-   `IN` and `OUT` - Function parameter decorators. They provide a hint about the intention and direction of data flow. `IN` indicates that the parameter is an input parameter, meaning it provides data to the function. `OUT` indicates that the parameter is an output parameter, meaning the function will modify or provide data through that parameter.\n\n-   `LINE_TERMINATOR` - Represent the line terminator character sequence in Unreal Engine. It provides a platform-independent way of specifying line breaks in text files or strings.\n\n-   `CONSTEXPR` - Declare a constant expression. It is used in conjunction with the `constexpr` keyword[^1] to specify that a function or variable can be evaluated at compile-time and treated as a constant expression.\n\n-   `ABSTRACT` - Declare an abstract class. It indicates that a class cannot be instantiated directly and must be subclassed. An abstract class serves as a base class for other classes and provides a blueprint for their common functionality.\n\n-   `UPROPERTY()` - Defines the type and behavior of the property, as well as its metadata and display names.\n-   `UFUNCTION()` - Defines the parameters and return type of the function, as well as its behavior and metadata.\n-   `UCLASS()` - Defines the properties and behavior of the class, including its inheritance hierarchy, default properties, and editor metadata.\n-   `USTRUCT()` - Defines the properties and behavior of the struct, including its fields, default values, and editor metadata.\n-   `UINTERFACE()` - Defines the values of the enumeration, as well as its metadata and display names.\n-   `UPARAM()` - Specify additional metadata for function parameters in Unreal Engine. This metadata can be used for a variety of purposes, such as specifying the category or tooltip for the parameter in the editor.\n-   `UENUM()` - Define an enumeration that can be used in Unreal Engine classes. This allows developers to define a set of named constants that can be used in a type-safe way.\n-   `UMETA()` - Specify additional metadata for enumeration values in Unreal Engine. This metadata can be used for a variety of purposes, such as specifying the display name or tooltip for the value in the editor.\n\n-   `INLINE` - Suggestion to the compiler that a function should be inlined, but the compiler is not required to honor it. (Replacement for `inline` keyword[^1])\n-   `FORCEINLINE` - A stronger suggestion that the compiler should inline the function if possible, and it may even produce an error if the function cannot be inlined. (Replacement for `force_inline` keyword[^1])'\n\n-   `UE_LOG` - Outputs the log message into the log file. The first input parameter it takes is the name of the logging category.\n\n-   `check` and `checkf` (**NOT ALLOWED IN BUILDS**) - Halts execution if `Expression` is false. `checkf` outputs `FormattedText` to the log.\n-   `verify` and `verifyf` (**ALLOWED IN BUILDS**) - Halts execution if `Expression` is false. `verifyf` outputs `FormattedText` to the log.\n-   `ensure` and `ensureMsgf` (**ALLOWED IN BUILDS**) - Notifies the crash reporter on the first time `Expression` is false. `ensureMsgf` outputs `FormattedText` to the log.\n-   `ensureAlways` and `ensureAlwaysMsgf` (**ALLOWED IN BUILDS**) - Notifies the crash reporter if Expression is false. `ensureAlwaysMsgf` outputs `FormattedText` to the log.\n\n-   `unimplemented` - Halts execution if the line is ever hit, similar to `check(false)`, but intended for virtual functions that should be overridden and not called.\n\n-   `checkCode` - Executes `Code` within a do-while loop structure that runs once; primarily useful as a way to prepare information that another Check requires.\n-   `checkNoEntry` - Halts execution if the line is ever hit, similar to `check(false)`, but intended for code paths that should be unreachable\n-   `checkNoReentry` - Halts execution if the line is hit more than once.\n-   `checkNoRecursion` - Halts execution if the line is hit more than once without leaving scope.\n\nWhat are inlined functions?\n\n\u003e When a function is inlined, the compiler replaces the function call with the actual code of the function, as if the code had been written directly in place of the call.\n\u003e\n\u003e This can improve performance by eliminating the overhead of a function call, but it can also increase the size of the executable.\n\nDifference between a macro and function then?\n\n\u003e While both macros[^4] and `FORCEINLINE` functions can be used to improve performance and reduce code repetition, `FORCEINLINE` functions are generally preferred over macros[^4] in Unreal Engine, as they offer type safety, scoping and visibility rules, and better debugging support.\n\n## 📜 Logging\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nAll logs will be saved at: `YourProjectName\\Saved\\Logs`.\n\nIn order to view the log history inside the editor, you can access the window via: `Window -\u003e Developer Tools -\u003e Output Log`.\n\nYou can also access the log history via console command, by typing: `showlog` into the console.\n\nTo log to the console with C++ in Unreal Engine, you can use `UE_LOG()` macro. This macro takes in a couple of arguments.\n\n1. Log Category\n2. Log Verbosity\n3. The actual text to log to the console\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\nPredefined log categories\n\n-   `LogPath`\n-   `LogController`\n-   `LogPhysics`\n-   `LogBlueprint`\n-   `LogBlueprintUserMessages`\n-   `LogAnimation`\n-   `LogRootMotion`\n-   `LogLevel`\n-   `LogSkeletalMesh`\n-   `LogStaticMesh`\n-   `LogNet`\n-   `LogRep`\n-   `LogNetPlayerMovement`\n-   `LogNetTraffic`\n-   `LogRepTraffic`\n-   `LogNetFastTArray`\n-   `LogNetDormancy`\n-   `LogSkeletalControl`\n-   `LogSubtitle`\n-   `LogTexture`\n-   `LogPlayerManagement`\n-   `LogSecurity`\n-   `LogEngineSessionManager`\n-   `LogHAL`\n-   `LogSerialization`\n-   `LogUnrealMath`\n-   `LogUnrealMatrix`\n-   `LogContentComparisonCommandlet`\n-   `LogNetPackageMap`\n-   `LogNetSerialization`\n-   `LogMemory`\n-   `LogProfilingDebugging`\n-   `LogCore`\n-   `LogOutputDevice`\n-   `LogSHA`\n-   `LogStats`\n-   `LogStreaming`\n-   `LogInit`\n-   `LogExit`\n-   `LogExec`\n-   `LogScript`\n-   `LogLocalization`\n-   `LogLongPackageNames`\n-   `LogProcess`\n-   `LogLoad`\n-   `LogTemp`\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nThe most common log category, that you will probably use, is `LogTemp` and `LogBlueprintUserMessages` for Blueprint messages.\n\nYou can also define your own log category, by using the `DECLARE_LOG_CATEGORY_EXTERN()` and `DEFINE_LOG_CATEGORY()` macros.\n\nInside you header file, you can write:\n\n```cpp\n// .h\n\n// Arguments:\n// 1. Name of your custom category. You can use LogTemp if you don't want to define a category.\n// 2. Default verbosity when one is not specified. The most common value is Log.\n// Valid verbosity levels are: Fatal, Error, Warning, Display, Log, Verbose, VeryVerbose\n// 3. Maximum verbosity level to allow when compiling. Can also be All\nDECLARE_LOG_CATEGORY_EXTERN(MyLogCategory, Log, All);\n```\n\nThen inside the source file, you can write:\n\n```cpp\n// .cpp\n\n// Define the log category\nDEFINE_LOG_CATEGORY(MyLogCategory);\n```\n\nNow you can reuse the log category, via including the header file.\n\nHere is the list of types of verbosity levels:\n\n| Verbosity Level | Printed in Console ? | Printed in Editor's Log? | Notes                                            |\n| --------------- | -------------------- | ------------------------ | ------------------------------------------------ |\n| Fatal           | Yes                  | N / A                    | Crashes the session, even if logging is disabled |\n| Error           | Yes                  | Yes                      | Log text is coloured red                         |\n| Warning         | Yes                  | Yes                      | Log text is coloured yellow                      |\n| Display         | Yes                  | Yes                      | Log text is coloured grey                        |\n| Log             | No                   | Yes                      | Log text is coloured grey                        |\n| Verbose         | No                   | No                       |                                                  |\n| VeryVerbose     | No                   | No                       |                                                  |\n\nYou can also override some of the pre-existing verbosity levels. These settings can be set in either `Engine.ini` or `DefaultEngine.ini`.\n\nHere's an example of verbosity settings:\n\n```dosini\n[Core.Log]\nGlobal=\u003cCategory\u003e=\u003cDesiredVerbosityLevel\u003e\n```\n\n**Here's a couple of examples:**\n\nLog to the console with a simple string:\n\n```cpp\nUE_LOG(LogTemp, Warning, TEXT(\"Hello\"));\n```\n\nSimilar to `sprintf()` function in C++, where you can use specific different arguments into the string formatter. There are a couple of arguments type, that you need to know about.\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\n-   `%s` - strings\n-   `%d` or `%i` - integers and booleans\n-   `%f` - floating point numbers (float and double)\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nHow to log to the console with `FString` as an argument:\n\n```cpp\nUE_LOG(LogTemp, Warning, TEXT(\"The Actor's name is: %s\"), *YourActor-\u003eGetName());\n```\n\n\u003e [!TIP]\n\u003e You can use `__func__`, `__FUNCTION__` or `__PRETTY_FUNCTION__` to get the name of the function and print it out in the log. However, to add this string, you must convert it into a TCHAR pointer. By using `ANSI_TO_TCHAR()` macro.\n\nSadly, `UE_LOG` does **NOT** support `bool` data type.\n\nIn order to print a boolean with `UE_LOG`, you can use `%i` or `%d` to convert a `bool` (boolean) into a `int32` (integer).\n\nLog to the console with `bool` as an argument:\n\n```cpp\nbool bMyBoolean = true;\n\n// You can either use %d or %i. Both will print an integer.\nUE_LOG(LogTemp, Log, TEXT(\"The boolean value is: %i\"), bMyBoolean); // The boolean value is: 1\n\n// True -\u003e 1\n// False -\u003e 0\n```\n\nYou can also just convert the boolean into a string as well:\n\n```cpp\nbool bMyBoolean = false;\n\nUE_LOG(LogTemp, Log, TEXT(\"The boolean value is: %s\"), (bMyBoolean ? TEXT(\"true\") : TEXT(\"false\"))); // The boolean value is: false\n```\n\nLog to the console with `int32` as an argument:\n\n```cpp\nint32 MyInteger = 1337;\nUE_LOG(LogTemp, Log, TEXT(\"The integer value is: %d\"), MyInteger); // The integer value is: 1337\n```\n\nLog to the console with `float` as an argument:\n\n```cpp\nfloat MyFloat = 99.999999f;\nUE_LOG(LogTemp, Log, TEXT(\"The float value is: %f\"), MyFloat); // The float value is: 99.999999\n```\n\nLog to the console with `double` as an argument:\n\n```cpp\ndouble MyDouble = 3.1415926535897931;\nUE_LOG(LogTemp, Log, TEXT(\"The double value is: %f\"), MyDouble); // The double value is: 3.1415926535897931\n```\n\nLog to the console with `FVector` as an argument:\n\n```cpp\nFVector MyVector = FVector::OneVector;\n\n// In order to log a FVector, you need to convert into a string.\nUE_LOG(LogTemp, Log, TEXT(\"The vector value is: %s\"), *MyVector.ToString()); // The vector value is: (1, 1, 1)\n```\n\nLog to the console with `FName` as an argument:\n\n```cpp\n// In order to log a FName, you need to convert into a string.\nUE_LOG(LogTemp, Log, TEXT(\"The name is: %s\"), *MyCharacter-\u003eGetFName().ToString());\n```\n\nYou can also alter the decimal point, when printing floating point numbers.\n\nThis can help for readability’s sake.\n\nUsing `.2` will specify 2 digits after the decimal point.\n\nHere's an example:\n\n```cpp\ndouble MyDouble = 3.1415926535897931;\nUE_LOG(LogTemp, Log, TEXT(\"The double value is: %.2f\"), MyDouble); // The double value is: 3.14\nUE_LOG(LogTemp, Log, TEXT(\"The double value is: %.0f\"), MyDouble); // The double value is: 3\nUE_LOG(LogTemp, Log, TEXT(\"The double value is: %,2f\"), MyDouble); // The double value is: 3,14\n```\n\n### UE_LOGFMT\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\n-   UE_LOG is extremely verbose, requiring the developer to constantly wrap log text in the `TEXT` macro.\n-   UE_LOG is also incapable of printing basic types, such as `bool`, or `FStrings`, Unreal's standard String type.\n-   UE_LOG requires awareness of types when printing different variables such as float, integer, booleans, strings.\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nIn Unreal Engine 5.2, you can use `UE_LOGFMT()` macro instead! The new `UE_LOGFMT()` macro allows to alleviate many of these issues.\n\nHere's an example of using it:\n\nInclude the header file:\n\n```cpp\n#include \"Logging/StructuredLog.h\"\n```\n\nThen to log to the console, just write:\n\n```cpp\nUE_LOGFMT(LogTemp, Log, \"This message will print to my log\");\n```\n\nAnd to add some arguments, you can write:\n\n```cpp\nFString Name(\"SomeName\");\nint32 Value = 999;\n\nUE_LOGFMT(LogTemp, Log, \"Printing my Name: {0} with Value: {1}\", Name, Value); // Printing my Name: SomeName with Value: 999\n```\n\nHere's a couple of examples:\n\n```cpp\nUE_LOGFMT(LogCore, Warning, \"Loading '{0}' failed with error {1}\", Package-\u003eGetName(), ErrorCode);\n```\n\n```cpp\nUE_LOGFMT(LogCore, Warning, \"Loading '{Name}' failed with error {Error}\", (\"Error\", ErrorCode), (\"Name\", Package-\u003eGetName()), (\"Flags\", LoadFlags));\n```\n\n\u003e [!NOTE]\n\u003e FText is not supported with `UE_LOGFMT()`, in order to use `FText` you need to convert into `FString` by simply calling `ToString()` function.\n\n### Log to game-view\n\nCurrently, we have only logged to the console. In order to display the console messages inside the game-view, we need to call `AddOnScreenDebugMessage()` function instead. You can access this function inside the global engine variable (`GEngine`).\n\nHere's an example:\n\n```cpp\n/*\n\n    void AddOnScreenDebugMessage\n    (\n        uint64 Key, // A unique key to prevent the same message from being added multiple times.\n        float TimeToDisplay, // How long to display the message, in seconds.\n        FColor DisplayColor, // The color to display the text in.\n        const FString \u0026 DebugMessage, // The message to display.\n        bool bNewerOnTop,\n        const FVector2D \u0026 TextScale\n    )\n\n    Add a FString to the On-screen debug message system. bNewerOnTop only works with Key == INDEX_NONE\n    This function will add a debug message to the onscreen message list. It will be displayed for FrameCount frames.\n\n*/\n\nGEngine-\u003eAddOnScreenDebugMessage(-1, 5.0f, FColor::White, TEXT(\"This message will appear on the screen!\"));\n```\n\nAnd to provide arguments to this function, you need to use `FString::Printf()`, which is similar to `sprintf()` function and `UE_LOG()` macro.\n\nHere's an example, how to use `FString::Printf()` function `AddOnScreenDebugMessage()` function:\n\n```cpp\nGEngine-\u003eAddOnScreenDebugMessage(-1, 5.0f, FColor::Red, FString::Printf(TEXT(\"Some variable values: x = %f, y = %f\"), x, y));\n```\n\n## 🪨 Assertions\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n![Assertions](static/img/Assertions.png)\n\nAssertions are a programming technique used to detect and report errors or unexpected behavior in code. In Unreal Engine, assert macros are provided to make it easier to add assertions to code and to customize the behavior of the engine when an assertion fails.\n\n### Check\n\nUsed to test a condition at runtime and to report an error if the condition fails. If the condition is false, the `check(Expression)` macro will print an error message to the console and either halt the game or break into the debugger, depending on the configuration of the engine.\n\nThe `check(Expression)` macro is typically used to detect programming errors or unexpected runtime conditions.\n\n```cpp\nvoid MyFunction()\n{\n    APlayerCharacter* PC = Cast\u003cAPlayerController\u003e(GetController());\n\n    // If the condition returns false, the game will crash.\n    // By default, C++ and Unreal has some overloads for pointers and classes, which allows them to return as boolean.\n    check(PC);\n\n    // But, if you wish to be explicit:\n    check(PC != nullptr);\n}\n```\n\n### Verify\n\nSimilar to the `check(Expression)` macro, but is only enabled in debug builds of the engine. If the condition is false, the `verify(Expression)` macro will break into the debugger but will not halt the game.\n\nThe `verify(Expression)` macro is typically used to detect errors during development or testing, but does not impact the performance of the final release build.\n\n```cpp\nvoid MyFunction()\n{\n    APlayerCharacter* PC = Cast\u003cAPlayerController\u003e(GetController());\n\n    // Same as 'check' assertion.\n    // However, this assertion will include in all builds (including shipping builds).\n    verify(PC);\n}\n```\n\n### Ensure\n\nSimilar to the `check(Expression)` macro, but is used to test conditions that are not necessarily fatal to the program. If the condition is false, the `ensure(Expression)` macro will print a warning message to the console and either halt the game or break into the debugger, depending on the configuration of the engine.\n\nThe `ensure(Expression)` macro is typically used to detect non-fatal errors or unexpected conditions that can be recovered from.\n\n```cpp\nvoid MyFunction()\n{\n    APlayerCharacter* PC = Cast\u003cAPlayerController\u003e(GetController());\n\n    // Non-critical check (assertion only during development and editor builds).\n    // This will only call once and will not retrigger for each play.\n    ensure(PC);\n\n    // To have this assertion retriggerable, then use this macro instead:\n    ensureAlways(PC);\n}\n```\n\n### Alternatives Assertions\n\nThere is also alternatives macros[^4] that displays text.\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\n-   `checkf(Expression, FormattedText, ...)` or `checkfSlow(Expression, FormattedText, ...)` - Halts execution if `Expression` is false and outputs `FormattedText` to the log\n-   `verifyf(Expression, FormattedText, ...)` or `verifySlow(Expression, FormattedText, ...)` - Halts execution if `Expression` is false and outputs `FormattedText` to the log.\n-   `ensureMsgf(Expression, FormattedText, ...)` - Notifies the crash reporter and outputs `FormattedText` to the log on the first time `Expression` is false.\n-   `ensureAlwaysMsgf(Expression, FormattedText, ...)` - Notifies the crash reporter and outputs `FormattedText` to the log if `Expression` is false.\n\n```cpp\nvoid MyFunction()\n{\n    APlayerCharacter* PC = Cast\u003cAPlayerController\u003e(GetController());\n    checkf(PC, TEXT(\"Player character cannot be null!\"));\n\n    ULocalPlayer LP = PC-\u003eGetLocalPlayer();\n    verifyf(LP, TEXT(\"Local player cannot be null in shipping builds!\"));\n\n    bool bIsDead = false;\n    ensureMsgf(bIsDead, TEXT(\"Player shouldn't be dead!\"));\n}\n```\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n### Misc Assertions\n\nThere is also an `unimplemented` assert macro. Useful for writing functions that require code, but is currently unimplemented.\n\n```cpp\nvoid DoSomething()\n{\n    unimplemented();\n}\n```\n\nAnother assert macro is `checkCode`. Which is an asserted marco to check your code is valid. Behind the scene, the code runs inside a do-while loop with while set to false. This prevents from looping. The main point of using this technique is to clean up memory afterwards and the ability to use `continue` or `break` keyword.\n\n```cpp\ncheckCode(\n    if (ObjectItem-\u003eIsPendingKill())\n    {\n        UE_LOG(LogGarbage, Fatal, TEXT(\"Object %s is part of root set though has been marked RF_PendingKill!\"), *Object-\u003eGetFullName());\n    }\n);\n```\n\nAnd lastly, we have `checkNoEntry`, `checkNoReentry` and `checkNoRecursion` assert macros.\n\n-   `checkNoEntry` indicates that code should never be reached.\n-   `checkNoReentry` indicates that code should not be executed more than once.\n-   `checkNoRecursion` indicates that code should never be called recursively.\n\n```cpp\nvoid KillPlayer()\n{\n    PlayerPtr-\u003eDestroy();\n    PlayerPtr = nullptr;\n\n    if (IsValid(Player))\n    {\n        checkNoEntry();\n    }\n}\n\nvoid CleanupCharacters(int32 Count)\n{\n    if (Count \u003e 3)\n        return;\n\n    checkNoRecursion();\n\n    if (IsValid(Player))\n    {\n        checkNoReentry();\n        KillPlayer();\n    }\n\n    CleanupCharacters(Count + 1);\n}\n```\n\n---\n\nYou can read more about [Assertions from the docs](https://docs.unrealengine.com/5.1/en-US/asserts-in-unreal-engine/).\n\nYou can also watch a video about it from [Sneaky Kitty Game Dev](https://www.youtube.com/watch?v=zGeJgI2xiT4).\n\n---\n\n| Assertion | Description                                                                                                                                                                                             | Use Cases                                                                                                                                                          |\n| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `check`   | A macro used for runtime checks in Unreal Engine, which is enabled only in Debug builds.                                                                                                                | - Validating preconditions or assumptions in the code.\u003cbr\u003e- Ensuring that critical conditions are met during development and debugging.                            |\n|           | If the condition specified in the `check` macro evaluates to false, it triggers an assertion failure, halting the program's execution in Debug mode, allowing developers to identify and fix the issue. | - Detecting potential bugs or logic errors during development.\u003cbr\u003e- Identifying unexpected conditions that should not occur during testing or debugging.           |\n|           | The `check` macro is compiled out in non-Debug builds, so it has no impact on the performance of the release version of the game.                                                                       |                                                                                                                                                                    |\n|           |                                                                                                                                                                                                         |                                                                                                                                                                    |\n| `verify`  | A macro similar to `check`, used for runtime checks in Unreal Engine, but it is enabled in both Debug and Release builds.                                                                               | - Similar use cases as `check`, but with the intention of detecting issues in both Debug and Release builds.\u003cbr\u003e- Useful for crucial runtime checks in production. |\n|           | If the condition specified in the `verify` macro evaluates to false, it triggers an assertion failure in both Debug and Release builds, halting the program's execution.                                |                                                                                                                                                                    |\n|           | This can help identify and fix critical issues even in the final release version of the game or application.                                                                                            |                                                                                                                                                                    |\n|           |                                                                                                                                                                                                         |                                                                                                                                                                    |\n| `ensure`  | A macro specifically designed for Unreal Engine, used for runtime checks with a focus on improving the robustness of code in shipping games.                                                            | - Verifying and enforcing assumptions, preconditions, and invariants in the code to avoid crashes and unexpected behavior in production environments.              |\n|           | The `ensure` macro remains active in both Debug and Release builds, and its behavior can be configured in the Unreal Editor project settings.                                                           | - In a shipping build, `ensure` can be set to log a message or perform a fail-safe action instead of halting the program's execution.                              |\n|           | If the condition specified in the `ensure` macro evaluates to false, it may trigger an assertion or perform an alternative action based on project settings.                                            |                                                                                                                                                                    |\n\n## 🔔 Delegates\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n![Delegates](static/img/Delegates.png)\n\nA delegate is essentially a type-safe function pointer that can be used to bind one or more functions to an event, and then trigger those functions when the event occurs.\n\nIn Blueprint, you might have encounter \"**Event Dispatcher**\", which under the hood is just multicast delegate.\n\nThere are three types of delegates, that Unreal uses. **Single**, **Multicast** and **Dynamic**.\n\nDynamic or non-dynamic essential means if we want to support binding functions inside Blueprint via reflection system[^1], which tends to be slower in performance. And non-dynamic only support binding function inside C++ code.\n\nThen, we have multicast and single delegate. Multicast support multiple listener and execute them all at once. Whist the single delegate only support one listener at all time.\n\nYou can read more about multicast delegates, at [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/multicast-delegates-in-unreal-engine/).\n\n### Define a delegate type\n\nTo define a dynamic multicast delegate, you can declare via this macro: `DECLARE_DYNAMIC_MULTICAST_DELEGATE()`, which takes the name of the delegate as an argument.\n\n```cpp\nDECLARE_DYNAMIC_MULTICAST_DELEGATE(FMyDelegate);\n```\n\nTo define a non-dynamic multicast delegate, you can declare via this macro: `DECLARE_MULTICAST_DELEGATE()`, which takes the name of the delegate as an argument.\n\n```cpp\nDECLARE_MULTICAST_DELEGATE(FMyDelegate);\n```\n\nTo define a dynamic single delegate, you can declare via this macro: `DECLARE_DYNAMIC_DELEGATE()`, which takes the name of the delegate as an argument.\n\n```cpp\nDECLARE_DYNAMIC_DELEGATE(FMyDelegate);\n```\n\nTo define a non-dynamic single delegate, you can declare via this macro: `DECLARE_DELEGATE()`, which takes the name of the delegate as an argument.\n\n```cpp\nDECLARE_DELEGATE(FMyDelegate);\n```\n\n### Declare a delegate variable\n\nOnce you have defined a delegate type, you can declare a delegate variable of that type. This is done using the `UPROPERTY()` macro to ensure that the delegate variable is properly managed by the Unreal Engine.\n\n```cpp\nUPROPERTY(BlueprintAssignable)\nFMyDelegate MyEvent;\n```\n\n### Bind functions to the delegate\n\nWith the dynamic delegate variable declared, you can now bind one or more functions to it using the `BindDynamic()` macro.\n\nThese are macros, will helps you to write smaller code. Behind the scenes, it will automatically generates the function name string. The macro takes a reference to the object that owns the function, the name of the function, and an optional user data parameter.\n\n-   `BindDynamic(UserObject, FuncName, ...)`\n-   `AddDynamic(UserObject, FuncName)`\n-   `RemoveDynamic(UserObject, FuncName)`\n\n```cpp\nMyEvent.BindDynamic(this, \u0026AMyActor::MyFunction);\n```\n\n```cpp\nMyEvent.AddDynamic(this, \u0026AMyActor::MyFunction);\n```\n\n```cpp\nMyEvent.RemoveDynamic(this, \u0026AMyActor::MyFunction);\n```\n\nWith some arguments:\n\n```cpp\nMyEvent.BindDynamic(this, \u0026AMyActor::MyFunction, 100, true, TEXT(\"Hello, World!\"));\n```\n\n\u003c!-- DECLARE_DYNAMIC_DELEGATE[_RetVal, ...]( DelegateName ) --\u003e\n\nHere is a list of binding functions for Non-Dynamic Single Delegate:\n\n-   `Bind()` - Binds to an existing delegate object. This allows you to bind a delegate to an existing delegate, allowing for a more flexible way of binding delegates together.\n\n-   `BindLambda()` - Binds a functor. This is generally used for lambda functions. The functor is stored by value, so make sure it's small and efficient to copy.\n\n-   `BindRaw()` - Binds a raw C++ pointer delegate. Since raw pointers do not use any sort of reference, calling `Execute()` or `ExecuteIfBound()` after deleting the target object is unsafe.\n\n-   `BindStatic()` - Binds a raw C++ pointer global function delegate. This is useful for binding to global functions that are not members of any class.\n\n-   `BindSP()` - Binds a shared pointer-based member function delegate. Shared pointer delegates keep a weak reference to your object. You can use `ExecuteIfBound()` to call them.\n\n-   `BindUFunction()` - Binds a `UFunction` delegate. This allows you to bind to a blueprint function or a function in a `UObject` subclass. When the delegate is executed, it will call the function on the object it was bound to at the time of binding. If the object is garbage collected, the delegate will not be executed. You can use `ExecuteIfBound()` to call the function if it's still valid.\n\n-   `BindUObject()` - Binds a `UObject` member function delegate. `UObject` delegates keep a weak reference to the `UObject` you target. You can use `ExecuteIfBound()` to call them.\n\n-   `BindWeakLambda()` - Binds a functor that keeps a weak reference to the object it's bound to. This allows you to bind a delegate to an object that may be garbage collected. When the delegate is executed, it will check if the object is still valid. If it is, it will call the functor. If it's not, the delegate will not be executed.\n\n-   `BindThreadSafeSP()` - Binds a shared pointer-based member function delegate that is safe to call from any thread. This is similar to `BindSP()`, but it uses a thread-safe reference counting scheme.\n\n-   `UnBind()` - Unbinds this delegate. This will clear the delegate, so it will not be executed when triggered.\n\nAnd here is the list of binding functions for Non-Dynamic Multicast Delegate:\n\n-   `Add()` - Adds a function delegate to this multi-cast delegate's invocation list. The delegate will be executed when the `Broadcast()` function is called.\n\n-   `AddLambda()` - Adds a functor (a lambda, a std::function, or a functor class) as a delegate. The delegate will be executed when the `Broadcast()` function is called.\n\n-   `AddRaw()` - Adds a raw C++ pointer delegate. The delegate will be executed when the `Broadcast()` function is called. The delegate will be invoked with the specified parameters.\n\n-   `AddStatic()` - Adds a raw C++ pointer global function delegate. The delegate will be executed when the `Broadcast()` function is called. The delegate will be invoked with the specified parameters.\n\n-   `AddSP()` - Adds a shared pointer-based (fast, not thread-safe) member function delegate. Shared pointer delegates keep a weak reference to your object. The delegate will be executed when the `Broadcast()` function is called. The delegate will be invoked with the specified parameters.\n\n-   `AddUObject()` - Adds a UObject-based member function delegate. UObject delegates keep a weak reference to your object. The delegate will be executed when the `Broadcast()` function is called. The delegate will be invoked with the specified parameters.\n\n-   `AddUFunction()` - Adds a UFunction delegate. The delegate will be executed when the `Broadcast()` function is called. The delegate will be invoked with the specified parameters.\n\n-   `AddWeakLambda()` - Adds a functor that keeps a weak reference to the object it's bound to. This allows you to bind a delegate to an object that may be garbage collected. When the delegate is executed, it will check if the object is still valid. If it is, it will call the functor. If it's not, the delegate will not be executed. The delegate will be executed when the `Broadcast()` function is called. The delegate will be invoked with the specified parameters.\n\n-   `AddThreadSafeSP()` - Adds a shared pointer-based member function delegate that is safe to call from any thread. This is similar to `AddSP()`, but it uses a thread-safe reference counting scheme. The delegate will be executed when the `Broadcast()` function is called. The delegate will be invoked with the specified parameters.\n\n### Trigger the delegate\n\nFinally, you can trigger the multicast delegate by calling the `Broadcast()` method. This will cause all bound functions to be called with the specified parameters.\n\n```cpp\nMyEvent.Broadcast();\n```\n\nAnd you can also trigger a single delegate, by calling the `Execute()` or `ExecuteIfBound()` method. This will cause the bound function to be called with the specified parameters.\n\n```cpp\n// If delegate is not bound, this will cause a crash.\nMyEvent.Execute();\n\n// Use this function, if you are unsure, if the delegate is bound or not.\nMyEvent.ExecuteIfBound();\n\n// You can also do manual checking, before calling ´Execute()´ function.\nbool bIsBound = MyEvent.IsBound();\n```\n\n### Summary\n\nBy using delegates, developers can create modular and flexible event systems that can be easily extended and customized.\n\nDelegates can be used to trigger events in response to user input, game state changes, or other types of events, and can be used to implement a wide variety of gameplay features and mechanics.\n\n\u003e [!TIP]\n\u003e Here is an [online tool by BenUI](https://benui.ca/unreal/delegates-advanced/#delegate-signature-tool) for helping you to create a delegate macro.\n\n\u003e [!TIP]\n\u003e Try to **USE** delegates where ticking is not necessary. This help save on performance on tick\n\n\u003e [!CAUTION]\n\u003e If you bind a delegate with raw binding, and don't remove the binding afterward, when the `UObject` gets destroyed. This will cause a memory leak. Since, the binding is still alive, even though the `UObject` not be alive. Therefore, is recommended to bind directly the `UObject` or `UFunction`.\n\n| Type                                         | Binds C++ Function | Binds `UFUNCTION` |\n| -------------------------------------------- | ------------------ | ----------------- |\n| Singlecast                                   | Yes                | Yes               |\n| Multicast                                    | Yes                | No                |\n| ~~Event~~ (**OBSOLETE**)                     | Yes                | ?                 |\n| Dynamic Singlecast                           | No                 | Yes               |\n| Dynamic Multicast                            | No                 | Yes               |\n| `FTimerDelegate` (Singlecast)                | Yes                | Yes               |\n| `FTimerDynamicDelegate` (Dynamic Singlecast) | No                 | Yes               |\n\n## 🧩 UMG\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nUMG (Unreal Motion Graphics) is a visual interface authoring tool in Unreal Engine that enables the creation of user interfaces (UI) and interactive elements for games and applications. It provides a user-friendly, node-based system for designing UI elements and connecting them to C++ code for functionality and interactivity.\n\nYou can read more about from the [docs](https://docs.unrealengine.com/5.2/en-US/umg-ui-designer-for-unreal-engine/).\n\nThere is also a video about [UMG Widgets with C++ by Lively Geek](https://www.youtube.com/watch?v=T7v3UnL6PNU).\n\n### UMG with C++\n\nTo control Blueprint-created widgets from C++ in Unreal Engine, you can use the `BindWidget` meta property. This powerful feature allows you to establish a connection between widgets created in the Unreal Motion Graphics (UMG) editor and corresponding C++ variables.\n\nBy applying the `BindWidget` meta property to a C++ variable, you can establish the link between the widget and the variable, giving you direct access to the widget's properties and functionalities within your C++ code.\n\nHere's an example that demonstrates how to use `BindWidget`:\n\n```cpp\nUPROPERTY(meta=(BindWidget)) // Binding via UMG editor\nUTextBlock* PlayerDisplayNameText;\n```\n\nIn this example, the `PlayerDisplayNameText` variable is declared as a `UTextBlock*` type, representing a text widget. The `meta=(BindWidget)` property indicates that this variable is bound to a widget created in the UMG editor.\n\nWith this binding in place, you can now access and control all the properties and functions of the `PlayerDisplayNameText` widget directly from your C++ code. This allows you to manipulate the widget's appearance, handle user interactions, and update its content dynamically based on game logic or user input.\n\nHere's an example showcasing the usage of the widget:\n\n```cpp\n#include \"MainMenu.h\"\n\nvoid UMainMenu::NativeConstruct()\n{\n    if (PlayerDisplayNameText == nullptr)\n        return;\n\n    PlayerDisplayNameText-\u003eOnClicked.AddDynamic(this, \u0026UMainMenu::UpdatePlayerDisplayName);\n}\n\nvoid UMainMenu::UpdatePlayerDisplayName()\n{\n    if (PlayerDisplayNameText == nullptr)\n        return;\n\n    const FString\u0026 NewDisplayName = TEXT(\"John Doe\");\n    PlayerDisplayNameText-\u003eSetText(FText::FromString(NewDisplayName));\n}\n```\n\nIn this example, assume we have a custom player character class called `AMyPlayerCharacter`. The `UpdatePlayerDisplayName()` function receives a `NewDisplayName` as a parameter, which represents the updated display name for the player.\n\nInside the function, we check if the `PlayerDisplayNameText` widget is valid. If it is, we use the `SetText()` function to update the text displayed by the widget. In this case, we convert the `NewDisplayName` string to an FText object using `FText::FromString` before assigning it to the `PlayerDisplayNameText` widget.\n\nYou can read more about binding widgets with C++ from the [article by BenUI](https://benui.ca/unreal/ui-bindwidget/).\n\n### UI Tweening Library\n\n[BenUI](https://benui.ca/) has also created a free helpful plugin, which helps you animate UMG in C++. Plugin can be install from github[^5]. [Link to repository](https://github.com/benui-dev/UE-BUITween).\n\nHere's an example from UI Tweening Library:\n\n```cpp\nUBUITween::Create( SomeWidget, 0.2f )\n\t.FromTranslation( FVector2D( -100, 0 ) )\n\t.FromOpacity( 0.2f )\n\t.ToTranslation( FVector2D( 20, 10 ) )\n\t.ToOpacity( 1.0f )\n\t.Begin();\n```\n\n## 📚 Create custom module\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nIn Unreal Engine, a module is a way to organize game code into smaller pieces, similar to Unity's Assembly Definitions. By separating code into modules, you can reduce compile times and keep your code more organized.\n\nFor example, you could create a module called `Vehicle` to contain all the code related to the vehicle system. This would allow you to isolate the vehicle code from other parts of the game, such as the inventory system, and make it easier to maintain and update.\n\n\u003e [!NOTE]\n\u003e Unreal Engine modules are **NOT** related to C++ 20 modules.\n\nYou can read more about Unreal Engine's modules [here](https://dev.epicgames.com/documentation/en-us/unreal-engine/unreal-engine-modules)!\n\nHere is a list of common Unreal Engine's modules:\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\n-   Core\n-   CoreUObject\n-   InputCore\n-   Engine\n-   UnrealEd\n-   SlateCore\n-   Slate\n-   UMG\n-   UMGEditor\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nWorking with modules can also help you stay focused on the specific functionality you're implementing, as you only need to work with the code relevant to that module.\n\n### Module structure\n\nAll modules should be placed in the Source directory for either a plugin or project. The module's root folder should have the same name as the corresponding module.\n\nThere should also be a _[ModuleName].Build.csfile_ for each module in its root folder, and its C++ code should be contained in **Private** and **Public** folders.\n\n![image](https://user-images.githubusercontent.com/61658252/236797649-1acb5aac-ab05-4676-86a4-959e443de404.png)\n\n### Module code\n\n```csharp\n// Gameplay.Build.cs\n\nusing UnrealBuildTool;\n\npublic class Gameplay : ModuleRules\n{\n    public Gameplay(ReadOnlyTargetRules Target) : base(Target)\n    {\n        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;\n\n        PublicIncludePaths.AddRange(new string[]\n        {\n            // ... add public include paths required here ...\n        });\n\n\n        PrivateIncludePaths.AddRange(new string[]\n        {\n            // ... add other private include paths required here ...\n        });\n\n\n        PublicDependencyModuleNames.AddRange(new string[]\n        {\n            \"Core\",\n            // ... add other public dependencies that you statically link with here ...\n        });\n\n        PrivateDependencyModuleNames.AddRange(new string[]\n        {\n            // ... add private dependencies that you statically link with here ...\n\n            // NOTE, private dependencies will not be required to import in other modules\n            // This means, if you require a plugin but don't want to import in other modules, here is the list for that.\n        });\n\n        DynamicallyLoadedModuleNames.AddRange(new string[]\n        {\n            // ... add any modules that your module loads dynamically here ...\n        });\n    }\n}\n```\n\n```cpp\n// Private/GameplayModule.cpp\n\n#include \"Modules/ModuleManager.h\"\n\n// NOTE, this macro is handling the default implementation for a module setup.\nIMPLEMENT_MODULE(FDefaultModuleImpl, Gameplay);\n```\n\nIf you require more setup for a module (callbacks on the editor), you must create a specific class for that.\n\nHere is a full setup of module class:\n\n```cpp\n// Private/GameplayModule.cpp\n\n#include \"GameplayModule.h\"\n\n#define LOCTEXT_NAMESPACE \"FGameplayModule\"\n\nvoid FGameplayModule::StartupModule()\n{\n\t// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module\n}\n\nvoid FGameplayModule::ShutdownModule()\n{\n\t// This function may be called during shutdown to clean up your module.  For modules that support dynamic reloading,\n\t// we call this function before unloading the module.\n}\n\n#undef LOCTEXT_NAMESPACE\n\nIMPLEMENT_MODULE(FGameplayModule, Gameplay)\n```\n\n```cpp\n// Public/GameplayModule.h\n\n#pragma once\n\n#include \"CoreMinimal.h\"\n#include \"Modules/ModuleManager.h\"\n\nclass FGameplayModule : public IModuleInterface\n{\npublic:\n\n\t/** IModuleInterface implementation */\n\tvoid StartupModule() override;\n\tvoid ShutdownModule() override;\n};\n```\n\n### ♻️ Circular Dependency\n\nIt's possible to encounter circular dependencies when multiple modules access the same module. This occurs when module A depends on module B, and module B also depends on module A.\n\nTo resolve circular dependencies, you can take several approaches:\n\n-   One option is to use the `CircularlyReferencedDependentModules` statement in the [ModuleName].Build.cs file. You can read more about [here](https://forums.unrealengine.com/t/workaround-for-circular-dependencies/264945)!\n\nHere's an example:\n\n```cpp\nusing UnrealBuildTool;\n\npublic class ModuleB : ModuleRules\n{\n    public ModuleB(ReadOnlyTargetRules Target) : base(Target)\n    {\n        PrivateDependencyModuleNames.AddRange(new string[]\n        {\n            \"ModuleA\"\n        });\n\n        CircularlyReferencedDependentModules.Add(\"ModuleA\");  // Avoid circular dependencies errors!\n    }\n}\n```\n\n-   Another option is to create another module to further separate the code into smaller pieces.\n\n-   Finally, you can also refactor your modules to avoid circular dependencies altogether.\n\n_The best solution will depend on your specific situation and the complexity of your code._\n\n## 💡 Create custom plugin\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nPlugins are a powerful feature of the Unreal Engine that allows developers to easily extend and customize the engine's functionality to fit their specific needs. A plugin is essentially a module that can be added to a Unreal Engine project to provide additional features, tools, and content. Unlike modules, plugins are designed to be self-contained and can be shared across multiple projects.\n\nWhen you create a plugin, you can define your own modules, content, and assets that can be loaded and used in your project. Plugins can include any number of modules, each with their own classes, assets, and functionality. This allows you to keep your code organized and separated, making it easier to manage and maintain.\n\n**One of the biggest advantages of using plugins is that they can be shared with other developers, making it easy to create and distribute custom functionality to the Unreal Engine community. You can even sell your plugins on the Unreal Marketplace and earn revenue from your work.**\n\nPlugins can also be used to add support for third-party libraries and tools, such as physics engines or audio systems. This makes it easy to integrate these tools into your game and take advantage of their features without having to write custom code from scratch.\n\n*You can read more about plugins, \u003ca href=\"https://docs.unrealengine.com/5.1/en-US/plugins-in-unreal-engine/\" target=\"_blank\"\u003eover here\u003c/a\u003e!*\n\n## 📝 Preprocessor\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nIn programming languages, including C++, the preprocessor is a component of the compiler that performs text manipulation before the actual compilation process. It operates on the source code and handles directives starting with a hash symbol \u003ckbd\u003e#\u003c/kbd\u003e.\n\nIn C++, the preprocessor handles tasks such as macro expansion, file inclusion, and conditional compilation. It modifies the source code based on these directives before the code is compiled into machine-readable instructions.\n\nThe preprocessor can be used to define macros, which are text replacements performed by the preprocessor before the compilation stage. Macros[^4] allow for code reuse, conditional compilation, and other preprocessing operations. Directives like `#include` are used to include header files, and conditional directives like `#ifdef`, `#ifndef`, `#if`, and `#endif` are used for conditional compilation based on certain conditions.\n\nYou can read more about [Preprocessor from cppreference.com](https://en.cppreference.com/w/cpp/preprocessor).\n\nYou can also watch a video called [Preprocessor Directives\" by NeuralNine](https://www.youtube.com/watch?v=voGGB5TGsV4).\n\n### Pragma once\n\n`#pragma once` is a preprocessor directive used in C++ header files to ensure that the header is included only once during the compilation of a source file, regardless of how many times it is referenced.\n\nIt is an alternative to traditional header guards, which involve using #ifndef and #define statements to prevent multiple inclusions.\n`#pragma once` is a simpler and more efficient way to achieve the same effect, and is supported by most modern compilers.\n\nHere is an example:\n\n```cpp\n#pragma once\n\n#include \"Vehicle.generated.h\"\n\nUINTERFACE(BlueprintType)\nclass COMMONVEHICLE_API UVehicle : public UInterface\n{\n    GENERATED_UINTERFACE_BODY()\n};\n\nclass COMMONVEHICLE_API IVehicle\n{\n    GENERATED_IINTERFACE_BODY()\n    // ...\n};\n```\n\n### Strip out editor functionality\n\nUsing preprocessor directives to strip out editor functionality in Unreal Engine with C++ is a good habit, because it allows for efficient compilation and reduces the size of the final executable by excluding code that is specific to the editor but not needed in the final game build.\n\nFor an example, in this scenaro.\n\nHere's an example:\n\n```cpp\n#if WITH_EDITORONLY_DATA\n    UPROPERTY(VisibleAnywhere)\n    UArrowComponent* ArrowComponent;\n#endif\n\n#if WITH_EDITOR\nvoid SetupArrow()\n{\n  ArrowComponent-\u003eSetArrowColor(FLinearColor::Yellow);\n}\n#endif\n```\n\nIn this scenario, `ArrowComponent` is not needed for the final build. Only inside the editor version. Therefore, with the use of preprocessor, we can mark it for stripping. Once Unreal Engine is building/packing the game, the piece of code will be removed.\n\nYou can also use `#elif` as `else if` or `#else` as `else`, in order to branch off the stripping processes.\n\nHere is an updated example of this:\n\n```cpp\n#if WITH_EDITORONLY_DATA\n    UPROPERTY(VisibleAnywhere)\n    UArrowComponent* ArrowComponent;\n#endif\n\nvoid SetupArrow()\n{\n#if WITH_EDITOR\n    ArrowComponent-\u003eSetArrowColor(FLinearColor::Yellow);\n#else\n    GEngine-\u003eAddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, TEXT(\"Some debug message!\"));\n#endif\n}\n\n```\n\nYou can also used `UE_BUILD_SHIPPING` for negation to isolate debug code, so it wont be compiled in shipping build.\n\nExample:\n\n```cpp\nvoid APlayerCharacter::Kill()\n{\n#if !UE_BUILD_SHIPPING\n    GEngine-\u003eAddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT(\"Hello, World!\"));\n#endif\n}\n```\n\n## 🦄 Units\n\nWith UHT[^2], you can specify a specific unit for UPROPERTY values. Epic has already provided some of the basic units. Which it includes both metric and imperial system.\n\nHere's a list of units, that Epic has provided:\n\n```cpp\n/** Enum *must* be zero-indexed and sequential. Must be grouped by relevance and ordered by magnitude. */\n/** Enum *must* match the mirrored enum that exists in CoreUObject/Classes/Object.h for the purposes of UObject reflection */\nenum class EUnit : uint8\n{\n    /** Scalar distance/length units */\n    Micrometers, Millimeters, Centimeters, Meters, Kilometers,\n    Inches, Feet, Yards, Miles,\n    Lightyears,\n\n    /** Angular units */\n    Degrees, Radians,\n\n    /** Speed units */\n    CentimetersPerSecond, MetersPerSecond, KilometersPerHour, MilesPerHour,\n\n    /** Temperature units */\n    Celsius, Farenheit, Kelvin,\n\n    /** Mass units */\n    Micrograms, Milligrams, Grams, Kilograms, MetricTons,\n    Ounces, Pounds, Stones,\n\n    /** Force units */\n    Newtons, PoundsForce, KilogramsForce, KilogramCentimetersPerSecondSquared,\n\n    /** Torque Units */\n    NewtonMeters, KilogramCentimetersSquaredPerSecondSquared,\n\n    /** Frequency units */\n    Hertz, Kilohertz, Megahertz, Gigahertz, RevolutionsPerMinute,\n\n    /** Data Size units */\n    Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes,\n\n    /** Luminous flux units, luminous intensity, illuminance, luminance, exposure value */\n    Lumens, Candela, Lux, CandelaPerMeter2, ExposureValue,\n\n    /** Time units */\n    Nanoseconds, Microseconds, Milliseconds, Seconds, Minutes, Hours, Days, Months, Years,\n\n    /** Pixel density units */\n    PixelsPerInch,\n\n    /** Arbitrary multipliers */\n    Percentage,\tMultiplier,\n\n    /** Stress units */\n    Pascals, KiloPascals, MegaPascals, GigaPascals,\n\n    /** Symbolic entry, not specifiable on meta data */\n    Unspecified\n};\n```\n\nEnumeration that specifies particular classes of unit:\n\n```cpp\nenum class EUnitType\n{\n    Distance, Angle, Speed, Temperature, Mass, Force, Torque, Frequency, DataSize, LuminousFlux, LuminousIntensity, Illuminance, Luminance, Time, PixelDensity, Multipliers, ExposureValue, Stress,\n\n    // Symbolic entry - do not use directly\n    NumberOf,\n};\n```\n\n### Use cases with UHT\n\nNow, we know what types of units there are. We can now use them inside our code.\n\nFirst we can use them with UHT[^2], by specifying with meta tag.\n\n```cpp\nUPROPERTY(meta = (Units = \"kg\"))\nfloat MassInKg{ 10.0f };\n```\n\nBy default, Unreal will override your unit with the respective unit for that category. For an example, if I specified my mass variable to use **pounds**, Unreal will overwrite and use **kg** instead.\n\nIf you want to disable this feature, then you can use the specifier `ForceUnits` instead.\n\n```cpp\nUPROPERTY(meta = (ForceUnits = \"lbs\"))\nfloat MassInPounds{ 22.0f };\n```\n\n### Use cases with code\n\nUnreal also have a class for handling the unit conversion.\n\nHere's an example, on how to use conversion class:\n\n```cpp\nfloat Distance = 15.535f; // Unit: Miles\n\n// Miles -\u003e Kilometers\nDistance = FUnitConversion::Convert(Distance, EUnit::Miles, EUnit::Kilometers);\n\n// Distance: 25 [km]\n```\n\nYou can also get the specified unit category:\n\n```cpp\nEUnitType UnitType = FUnitConversion::GetUnitType(EUnit::Lumens);\n// UnitType: LuminousFlux\n```\n\nYou can also automatic change a unit to fit the best:\n\n```cpp\nfloat Distance = 300000.0f; // Units: Centimeters\nFNumericUnit\u003cfloat\u003e DistanceUnit = FUnitConversion::QuantizeUnitsToBestFit(Distance, EUnit::Centimeters); // Will auto select a better unit\n\nEUnit NewUnit = DistanceUnit.Units;\nfloat NewDistance = DistanceUnit.Value;\n\n// NewDistance: 3.0 [km]\n```\n\n## 🎨 Draw Debug Shapes\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nInclude the header file:\n\n```cpp\n#include \"DrawDebugHelpers.h\"\n```\n\n### Draw a point\n\n```cpp\nbool bPersistentLines = true;\n\nFVector Location = FVector(0, 0, 600);\nfloat Size = 200.0f;\nFColor Color = FColor(52, 220, 239);\n\nDrawDebugPoint(GetWorld(), Location, Size, Color, bPersistentLines);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_point.png\" alt=\"Draw Debug Point\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a sphere\n\n```cpp\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 2.0f;\n\nFVector Center = FVector(0, -600, 600);\nfloat Radius = 200.0f;\nint32 Segments = 26;\nFColor Color = FColor(255, 0, 0);\n\nDrawDebugSphere(GetWorld(), Center, Radius, Segments, Color, bPersistentLines, LifeTime, DepthPriority, Thickness);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_sphere.png\" alt=\"Draw Debug Sphere\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a circle\n\n```cpp\nfloat Radius = 200.0f;\nint32 Segments = 50;\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 10.0f;\n\n// Draw a circle via matrix\nFMatrix TransformMatrix = FMatrix();\nDrawDebugCircle(GetWorld(), TransformMatrix, Radius, Segments, FColor(0, 104, 167), bPersistentLines, LifeTime, DepthPriority, Thickness);\n\n// Draw a circle via location\nFVector Center = FVector(-300, 0, 600);\nDrawDebugCircle(GetWorld(), Center, Radius, Segments, FColor(0, 0, 0), bPersistentLines, LifeTime, DepthPriority, Thickness);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_circle.png\" alt=\"Draw Circle\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a circle arc\n\n```cpp\n\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 10.0f;\n\nFVector Center = FVector(-400, -600, 600);\nfloat Radius = 200.0f;\nFVector Direction = FVector::ForwardVector;\nfloat AngleWidth = 500.0;\nint32 Segments = 50;\nFColor Color = FColor::Yellow;\n\nDrawDebugCircleArc(GetWorld(), Center, Radius, Direction, AngleWidth, Segments, Color, bPersistentLines, LifeTime, DepthPriority, Thickness);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_circle_arc.png\" alt=\"Draw Cricle Arc\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a 2D donut\n\n```cpp\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 10.0f;\n\nconst FVector Location = FVector(-400, -600, 600);\nconst FTransform Transform = FTransform(FQuat::Identity, Location);\nFMatrix TransformMatrix = Transform.ToMatrixNoScale();\n\nfloat InnerRadius = 100.0f;\nfloat OuterRadius = 300.0f;\nint32 Segments = 26;\nFColor Color = FColor::Cyan;\n\nDrawDebug2DDonut(GetWorld(), TransformMatrix, InnerRadius, OuterRadius, Segments, Color, bPersistentLines, LifeTime, DepthPriority, Thickness);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_2d_donut.png\" alt=\"Draw Debug 2D Donut\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a solid box\n\n```cpp\nbool bPersistentLines = true;\n\n// Draw a solid box\nFVector MinPoint = FVector(0, 0, 0);\nFVector MaxPoint = FVector(200, 200, 200);\nFBox MyBox = FBox(MinPoint, MaxPoint);\nFTransform MyTransform = FTransform(FQuat::Identity, FVector(-400, -600, 600));\n\nDrawDebugSolidBox(GetWorld(), MyBox, FColor(200, 100, 50), MyTransform, bPersistentLines);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_solid_box.png\" alt=\"Draw Debug Soild Box\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a wired box\n\n```cpp\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 10.0f;\n\n// Draw a wired box\nFVector Center = FVector(-400, -600, 600);\nFVector Extent = FVector(100, 100, 100);\nFColor Color = FColor::Red;\n\nDrawDebugBox(GetWorld(), Center, Extent, Color, bPersistentLines, LifeTime, DepthPriority, Thickness);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_wired_box.png\" alt=\"Draw Debug Wired Box\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a cylinder\n\n```cpp\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 2.0f;\n\nFVector Start = FVector(0, -600, 600);\nFVector End = FVector(0, -1800, 600);\nfloat Radius = 200.0f;\nint32 Segments = 26;\nFColor Color = FColor(255, 0, 0);\n\nDrawDebugCylinder(GetWorld(), Start, End, Radius, Segments, Color, bPersistentLines, LifeTime, DepthPriority, Thickness);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_cylinder.png\" alt=\"Draw Debug Cylinder\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a capsule\n\n```cpp\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 2.0f;\n\nFVector Center = FVector(0, -600, 600);\nfloat HalfHeight = 400.0f;\nfloat Radius = 200.0f;\nFQuat Rotation = FQuat::Identity;\nFColor Color = FColor(255, 0, 0);\n\nDrawDebugCapsule(GetWorld(), Center, HalfHeight, Radius, Rotation, Color, bPersistentLines, LifeTime, DepthPriority, Thickness);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_capsule.png\" alt=\"Draw Debug Capsule\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a cone\n\n```cpp\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 0.0f;\n\nFVector Origin = FVector(0, -600, 0);\nFVector Direction = FVector(0, 0, -600);\nfloat Length = 100.0f;\nfloat AngleWidth = 45.0f;\nfloat AngleHeight = 45.0f;\nint32 NumSides = 12;\nFColor Color = FColor::Yellow;\n\nDrawDebugCone(\n    GetWorld(),\n    Origin,\n    Direction,\n    Length,\n    FMath::DegreesToRadians(AngleWidth),\n    FMath::DegreesToRadians(AngleHeight),\n    NumSides,\n    Color,\n    bPersistentLines,\n    LifeTime,\n    DepthPriority,\n    Thickness\n);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_cone.png\" alt=\"Draw Debug Cone\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a plane\n\n```cpp\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 2.0f;\n\nFVector NormalVector = FVector::UpVector;\nFPlane Plane = FPlane(NormalVector);\nFVector Location = FVector(0, -600, 600);\nFColor Color = FColor(255, 0, 0);\n\nfloat Size = 100.0f;\nDrawDebugSolidPlane(GetWorld(), Plane, Location, Size, Color, bPersistentLines, LifeTime, DepthPriority);\n\nFVector2D Extents = FVector2D::One();\nDrawDebugSolidPlane(GetWorld(), Plane, Location, Extents, Color, bPersistentLines, LifeTime, DepthPriority);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_plane.png\" alt=\"Draw Debug Plane\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a line\n\n```cpp\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 10.0f;\n\nFVector LocationFrom = FVector(0, -600, 600);\nFVector LocationTo = FVector(0, 600, 600);\nFColor Color = FColor::Emerald;\n\nDrawDebugLine(GetWorld(), LocationFrom, LocationTo, Color, bPersistentLines, LifeTime, DepthPriority, Thickness);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_line.png\" alt=\"Draw Debug Line\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw an arrow\n\n```cpp\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 5.0f;\n\nFVector LocationFrom =  FVector(-300, 600, 600);\nFVector LocationTo = FVector(-300, -600, 600);\nfloat ArrowSize = 120.0f;\nFColor Color = FColor::Magenta;\n\nDrawDebugDirectionalArrow(GetWorld(), LocationFrom, LocationTo, ArrowSize, Color, bPersistentLines, LifeTime, DepthPriority, Thickness);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_arrow.png\" alt=\"Draw Debug Arrow\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a crosshair\n\n```cpp\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\n\nFVector AxisLocation = FVector(0, 0, 1000);\nFRotator AxisRotation = FRotator::ZeroRotator;\nfloat Scale = 500.0f;\nFColor Color = FColor::White;\n\nDrawDebugCrosshairs(GetWorld(), AxisLocation, AxisRotation, Scale, Color, bPersistentLines, LifeTime, DepthPriority);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_crosshair.png\" alt=\"Draw Debug Crosshair\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a camera\n\n```cpp\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\n\nFVector Location = FVector(0, -600, 600);\nFRotator Rotation = FRotator::ZeroRotator;\nfloat FOVDeg = 45.0f;\nfloat Scale = 1.0f;\nFColor Color = FColor::White;\n\nDrawDebugCamera(GetWorld(), Location, Rotation, FOVDeg, Scale, Color, bPersistentLines, LifeTime, DepthPriority);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_camera.png\" alt=\"Draw Debug Camera\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a mesh\n\n```cpp\nFVector Offset = FVector(-300, 600, 600); // Example offset values\n\n// Vertices for a cube with offset\nconst TArray\u003cFVector\u003e Verts = {\n    FVector(-50, 50, 50) + Offset,  // 0\n    FVector(50, 50, 50) + Offset,   // 1\n    FVector(50, -50, 50) + Offset,  // 2\n    FVector(-50, -50, 50) + Offset, // 3\n    FVector(-50, 50, -50) + Offset, // 4\n    FVector(50, 50, -50) + Offset,  // 5\n    FVector(50, -50, -50) + Offset, // 6\n    FVector(-50, -50, -50) + Offset // 7\n};\n\n// Indices for a cube\nconst TArray\u003cint32\u003e Indices = {\n    0, 1, 2, 2, 3, 0, // Front face\n    1, 5, 6, 6, 2, 1, // Right face\n    5, 4, 7, 7, 6, 5, // Back face\n    4, 0, 3, 3, 7, 4, // Left face\n    4, 5, 1, 1, 0, 4, // Top face\n    3, 2, 6, 6, 7, 3  // Bottom face\n};\n\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nFColor Color = FColor(255, 0, 0);\n\nDrawDebugMesh(GetWorld(), Verts, Indices, Color, bPersistentLines, LifeTime, DepthPriority);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_mesh.png\" alt=\"Draw Debug Mesh\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a string:\n\n```cpp\nFVector TextLocation = FVector(0, -600, 600);\nFString Str = TEXT(\"Hello, World!\");\nAActor* TestBaseActor = NULL;\nFColor TextColor = FColor::White;\nfloat Duration = -1.0f;\nbool bDrawShadow = false;\nfloat FontScale = 5.0f;\n\nDrawDebugString(GetWorld(), TextLocation, Str, TestBaseActor, TextColor, Duration, bDrawShadow, FontScale);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_string.png\" alt=\"Draw Debug String\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Draw a centripetal catmull-rom spline\n\n```cpp\nFVector Offset = FVector(-300, 600, 600); // Example offset values\n\nTArray\u003cFVector\u003e Points;\nPoints.Emplace(FVector(0, 0, 0) + Offset); // Add the starting point with offset\nPoints.Emplace(FVector(100, 50, 0) + Offset); // Add the first control point with offset\nPoints.Emplace(FVector(200, 100, 0) + Offset); // Add the second control point with offset\nPoints.Emplace(FVector(300, 0, 0) + Offset); // Add the ending point with offset\n\nfloat Alpha = 0.5f;\nint32 NumSamplesPerSegment = 8;\n\nbool bPersistentLines = true;\nfloat LifeTime = -1.0f;\nuint8 DepthPriority = 0;\nfloat Thickness = 2.0f;\n\nFColor Color = FColor(255, 0, 0);\nDrawCentripetalCatmullRomSpline(GetWorld(), Points, Color, Alpha, NumSamplesPerSegment, bPersistentLines, LifeTime, DepthPriority, Thickness);\n\nTConstArrayView\u003cFColor\u003e Colors;\nDrawCentripetalCatmullRomSpline(GetWorld(), Points, Colors, Alpha, NumSamplesPerSegment, bPersistentLines, LifeTime, DepthPriority, Thickness);\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/debugging/draw_centripetal_catmull_rom_spline.png\" alt=\"Draw Debug Centripetal catmull-rom spline\" /\u003e\n    \u003cfigcaption\u003eResult\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n---\n\nYou can read more about [drawing shapes by Harrison McGuire](https://unrealcpp.com/draw-debug-helpers/).\n\nYou can also watch a [video about it from Ryan Sweeney](https://www.youtube.com/watch?v=FQQmdirfVYg).\n\n## ⚡ Compiling a plugin\n\nWhen you find a plugin and trying to install it, you might find out that it doesn't support your current engine version.\nAnd the Unreal's marketplace won't let you download unless you have a version associated.\n\nOne trick to avoid this, is to build the plugin manually and fixing compiling issues (header file missing or API changes). By installing the plugin with the access of the source code. Then by access the plugin with the UHT[^2] (Unreal Build Tool), you can then rebuild the plugin into a different engine version.\n\nHere is `.bat` file (**Windows Only**) to locate the current engine directory, and compile your custom made plugin into another engine version:\n\n```\n@echo off\n\n:: Setting up config variables\nset EngineVersion=\u003cEngineVersion\u003e\nset PluginName=\u003cPluginName\u003e\nset InputDirectory=\u003cInputDirectory\u003e\nset OutputDirectory=\u003cOutputDirectory\u003e\nset TargetPlatforms=Win64\n\nset PluginPath=\"%cd%\\%InputDirectory%\\%PluginName%\\%PluginName%.uplugin\"\nset OutputPath=\"%cd%\\%OutputDirectory%\\%EngineVersion%\\%PluginName%\"\n\n:: Locating a registry key, in order to find Unreal Engine source location\n\nfor /f \"skip=2 tokens=2*\" %%a in ('reg query \"HKEY_LOCAL_MACHINE\\SOFTWARE\\EpicGames\\Unreal Engine\\%EngineVersion%\" /v \"InstalledDirectory\"') do set \"EngineDirectory=%%b\"\n\nset AutomationToolPath=\"%EngineDirectory%\\Engine\\Build\\BatchFiles\\RunUAT.bat\"\n\ntitle Build Plugin\necho Automation Tool Path: \"%AutomationToolPath%\"\necho:\n\ncall %AutomationToolPath% BuildPlugin -Plugin=%PluginPath% -Package=%OutputPath% -Rocket -TargetPlatforms=%TargetPlatforms%\necho:\npause\nexit 0\n```\n\nAnd here is the bash file (**Linux Only**) version:\n\n```\n#!/bin/bash\n\n# Setting up config variables\nEngineVersion=\"\u003cEngineVersion\u003e\"\nPluginName=\"\u003cPluginName\u003e\"\nInputDirectory=\"\u003cInputDirectory\u003e\"\nOutputDirectory=\"\u003cOutputDirectory\u003e\"\nTargetPlatforms=\"Win64\"\n\nPluginPath=\"$PWD/$InputDirectory/$PluginName/$PluginName.uplugin\"\nOutputPath=\"$PWD/$OutputDirectory/$EngineVersion/$PluginName\"\n\n# Locating a registry key, in order to find Unreal Engine source location\nEngineDirectory=$(reg query \"HKEY_LOCAL_MACHINE\\SOFTWARE\\EpicGames\\Unreal Engine\\$EngineVersion\" -v \"InstalledDirectory\" | awk 'NR==3{print $NF}')\n\nAutomationToolPath=\"$EngineDirectory/Engine/Build/BatchFiles/RunUAT.bat\"\n\necho \"Automation Tool Path: \\\"$AutomationToolPath\\\"\"\necho\n\n$AutomationToolPath BuildPlugin -Plugin=\"$PluginPath\" -Package=\"$OutputPath\" -Rocket -TargetPlatforms=\"$TargetPlatforms\"\n\necho\nread -p \"Press Enter to continue...\"\nexit 0\n```\n\n## ⏳ Gameplay Timers\n\nTimer construct for performing delayed or repeated actions. Timers are incredibly helpful for gameplay scenarios.\n\n**Timers** schedule actions to be performed after a delay, or over a period of time. For example, you may want to make the player invulnerable after obtaining a power-up item, then restore vulnerability after 10 seconds. Or you may want to apply damage once per second while the player moves through a room filled with toxic gas. Such actions can be achieved through the use of timers.\n\n\u003e [!NOTE]\n\u003e Timers will be canceled automatically if the Object that they are going to be called on, such as an Actor, is destroyed before the time is up. In this case, the timer handle will become invalid and the function will not be called.\n\n```cpp\n// .h\n\n/* Handle to manage the timer */\nFTimerHandle TimerHandle;\n\n// Must mark a function with UFUNCTION, as UHT[^2] needs it, in order to find it.\nUFUNCTION()\nvoid OnExplode();\n```\n\n```cpp\n// .cpp\n\n/* Activate the bomb to explode after 1.5 seconds */\nvoid ABombActor::OnUsed(APawn* InstigatorPawn)\n{\n    float Delay = 1.5f; // In seconds\n    bool bLooping = false; // If we want to repeat this.\n\n    GetWorld()-\u003eGetTimerManager().SetTimer(\n        TimerHandle, // handle to cancel timer at a later time\n        this, // the owning object\n        \u0026ABombActor::OnExplode, // function to call on elapsed\n        Delay,\n        bLooping\n    );\n}\n\nvoid ABombActor::OnExplode()\n{\n    // ...\n}\n```\n\nInstead of calling `SetTimer()`, you can create delegate object with a bind function.\n\n```cpp\nFTimerHandle TimerHandle;\nFTimerDelegate Delegate; // Delegate to bind function with parameters\n\nDelegate.BindUFunction(this, \u0026ABombActor::OnExplode);\n\nfloat Delay = 1.5f;\nbool bLooping = false;\n\nGetWorld()-\u003eGetTimerManager().SetTimer(TimerHandle, Delegate, Delay, bLooping);\n```\n\nYou can also specify parameters, if you wish to pass to the bounded function:\n\n```cpp\nDelegate.BindUFunction(this, \u0026APlayerCharacter::Heal, 150, true);\n\nvoid Heal(int32 HealAmount, bool bReviveIfDead)\n{\n    // ...\n}\n```\n\nIf we wish to stop any of the timer, we can either call `ClearTimer()` or `ClearAllTimersForObject()`:\n\n```cpp\n// Clear the specified timer handle\nGetWorld()-\u003eGetTimerManager().ClearTimer(TimerHandle);\n\n// Alternatively you can clear ALL timers that belong to this (Actor) instance.\nGetWorld()-\u003eGetTimerManager().ClearAllTimersForObject(this);\n```\n\n\u003e [!TIP]\n\u003e Calling `SetTimer()` with a rate less than or equal to zero is identical to calling `ClearTimer()`.\n\nTo pause or unpause a timer, you can call either `PauseTimer()` or `UnPauseTimer()` function:\n\n```cpp\n// Pause the specified timer handle\nGetWorld()-\u003eGetTimerManager().PauseTimer(TimerHandle);\n\n// Unpause the specified timer handle\nGetWorld()-\u003eGetTimerManager().UnPauseTimer(TimerHandle);\n```\n\nTo check if a timer is running, you can call `IsTimerActive()` function:\n\n```cpp\n// Is this weapon waiting to be able to fire again?\nGetWorldTimerManager().IsTimerActive(this, \u0026AUTWeapon::RefireCheckTimer);\n```\n\nYou can also access the current rate (time between activations) of a timer from its timer handle:\n\n```cpp\n// This weapon's rate of fire changes as it warms up. Is it currently waiting to fire, and if so, how long is the current delay between shots?\nGetWorldTimerManager().GetTimerRate(this, \u0026AUTWeapon::RefireCheckTimer);\n```\n\nIf you want the elapsed and remaining time, you can access via `GetTimerElapsed()` function:\n\n```cpp\n// How long will it be until this weapon is ready to fire again? If the answer comes back as -1, it is ready now.\nGetWorldTimerManager().GetTimerElapsed(this, \u0026AUTWeapon::RefireCheckTimer);\n```\n\nYou can read more about [Gameplay Timers on Unreal's docs](https://docs.unrealengine.com/5.3/en-US/gameplay-timers-in-unreal-engine/).\n\n## 🧵 Gameplay Tags\n\nUnreal has Actor tags that can be used to tag certain actors in your game. However, actor tags has a common problem that around string tag system used in a game engine, mainly spelling mistake, case sensitivity and bad maintainability. To solve these problems, Unreal introduced **Gameplay Tags**.\n\nGameplay tags are a powerful string tag system in Unreal, that help you organize your tags in a hierarchical way. It uses a UI interface to create and manage tags, this prevents from spelling mistakes. It also increases the maintainability of your code.\n\nWith Gameplay tags, you can define a tag tree structure where each tag can have child tags. You can also query specific tags or child tags using the query syntax.\n\nYou can read more about [Gameplay Tags on Unreal's blog](https://www.unrealengine.com/es-ES/tech-blog/using-gameplay-tags-to-label-and-organize-your-content-in-ue4).\n\n\u003e [!IMPORTANT]\n\u003e In order to use Gameplay Tags in C++, you must include the module (`GameplayTags`) inside the build system.\n\nYou can also watch this video by [LeafBranchGames to learn all about Gameplay Tags](https://www.youtube.com/watch?v=edJGE0aidZY).\n\n## Usage\n\n\u003c!-- TODO: Add images --\u003e\n\nTo manage your pre-existing Gameplay Tags in your project, open the **Gameplay Tags** tab in your **Project Settings**.\n\nFor example, you can create a tag tree like this:\n\n-   `Weapon`\n    -   `Gun`\n        -   `Rifle`\n            -   `AK47`\n        -   `Pistol`\n            -   `Glock-18`\n        -   `Sniper`\n            -   `AWP`\n    -   `Melee`\n        -   `Knife`\n\nAnd then you can use the query syntax to find specific tags or child tags like this:\n\n-   `Weapon.Gun.Rifle` will return all the child tags of `Weapon.Gun.Rifle`\n-   `Weapon.Gun.Pistol` will return all the child tags of `Weapon.Gun.Pistol`\n-   `Weapon.Gun.Sniper` will return all the child tags of `Weapon.Gun.Sniper`\n-   `Weapon.Gun` will return all the child tags of `Weapon.Gun`\n-   `Weapon.Melee` will return all the child tags of `Weapon.Melee`\n-   `Weapon` will return all the child tags of `Weapon`\n\n## Data types\n\n-   [FGameplayTag](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/GameplayTags/FGameplayTag), is a single tag. which represents a hierarchical name of the form `x.y` that is registered in the **GameplayTagsManager**.\n\n-   [FGameplayTagContainer](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/GameplayTags/FGameplayTagContainer), holds a collection of tags.\n\n## Code\n\nTo use a Gameplay tag in code, you can do the following:\n\n```cpp\n// .h\n\n#include \"GameplayTagContainer.h\"\n\nUPROPERTY(EditAnywhere, BlueprintReadWrite, Category = \"GameplayTags\", meta = (Categories = \"Weapon.Gun\"))\nFGameplayTag GunTag;\n```\n\nTo define Gameplay tags in your code, you can do the following:\n\n```cpp\n// .h\n\n#include \"NativeGameplayTags.h\"\n\n/** Declares the \"Weapon.Gun.Rifle.AK47\" gameplay tag. */\nUE_DECLARE_GAMEPLAY_TAG_EXTERN(TAG_AK47)\n```\n\n```cpp\n// .cpp\n\n/** Define and expose the gameplay tag \"Weapon.Gun.Rifle.AK47\" to other modules and code. */\nUE_DEFINE_GAMEPLAY_TAG(TAG_AK47, \"Weapon.Gun.Rifle.AK47\");\n```\n\n\u003e [!NOTE]\n\u003e To avoid having to to use both `UE_DECLARE_GAMEPLAY_TAG_EXTERN()` and `UE_DEFINE_GAMEPLAY_TAG`, you can instead use: `UE_DEFINE_GAMEPLAY_TAG_STATIC()`. However, this macro should only used in the declared implementation file.\n\n```cpp\n// .cpp\n\n/** Defines and locks the gameplay tag \"Weapon.Melee.Knife\" to this implementation file. */\nUE_DEFINE_GAMEPLAY_TAG_STATIC(TAG_Weapon_Knife, \"Weapon.Melee.Knife\");\n```\n\nTo use these tags in your code, you can do the following:\n\n```cpp\nFGameplayTag Tag;\nbool bMatchesTag = Tag.MatchesTag(TEXT(\"MyTag\"));\n\nFGameplayTagContainer Tags;\nFGameplayTagContainer IgnoreTags;\nbool bHasTag = Tags.HasTag(TEXT(\"MyTag\"));\nbool bHasAnyTag = Tags.HasAny(IgnoreTags, TEXT(\"MyTag\"));\n```\n\n## 🧠 Multithreading and Asynchronous Tasks\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nThe most common way for a game engine to run your gameplay, is simply with a while loop. This pattern is very simple to understand and execute consistently. However, this pattern does not generate the greatest performance benefits. To gain performance, usually you would rewrite your code to be multithreaded.\n\nYou can read more about [Game Loop from Robert Nystrom](https://gameprogrammingpatterns.com/game-loop.html).\n\nAyliroé wrote an awesome documentation on Unreal's multithreading and asynchronous tasks system, which you can read either from [Google Docs](https://docs.google.com/document/d/1uw9Dfui5ZepSrBpMc1DrxFOeRFnDu8ubzFse8Mr_s7E/) or from [Forum Post](https://forums.unrealengine.com/t/multithreading-and-performance-in-unreal/1216417/1).\n\nBy the default, Unreal supports multithreading, but only makes partial use of it. While there are dedicated threads for audio, [render](https://docs.unrealengine.com/5.0/en-US/threaded-rendering-in-unreal-engine/) and stats, most operations are still done in the game thread, including EventTicks and Blueprints.\n\nThis is why doing expensive calculations in Blueprint will lead to loss of performance. That’s where threading comes in handy!\n\n### Multithreading\n\nMultithreading is the ability of a central processing unit (CPU) (or a single core in a multicore processor) to provide multiple threads of execution concurrently, supported by the operating system. In a multithreaded application, the threads share the resources of a single or multiple cores, which include the computing units, the CPU caches, and the translation lookaside buffer (TLB). This allows for faster speed of computation.\n\nIn order to make your game ready for multithreaded, then you're to change your mindset as well. When splitting your code into multiple threads can create [race conditions](https://en.wikipedia.org/wiki/Race_condition), which is when two operations are happening at the same time, and is competing for which one will be the first to execute. This can lead to instability and can cause bugs.\n\nYou can read more about [Multithreading from Vulkan Guide](https://vkguide.dev/docs/extra-chapter/multithreading/).\n\nYou can also watch a video from [Chris Kanich about deadlocks](https://www.youtube.com/watch?v=oEbXlSH8hyE).\n\nIf you want to create multithreading inside Blueprint will minimal C++ code, then here is a [video from Project Ispheria](https://www.youtube.com/watch?v=0Yyh3oQgonI).\n\n### Runnables\n\n`FRunnable` is a class which runs on a dedicated, newly created thread. Which you have full control over it.\n\nThey will automatically stop once their work is completed, and are generally useful for big computations that require a nearly continuously running thread.\n\nHere's an example:\n\n```cpp\n// .h\n#pragma once\n\n#include \"CoreMinimal.h\"\n#include \"HAL/Runnable.h\"\n\nclass FMyThread : public FRunnable\n{\npublic:\n    FMyThread( /*Parameters*/ )\n    {\n        bIsRunning = true;\n        Thread = FRunnableThread::Create(this, TEXT(\"MyThread\"));\n    };\n\n    virtual ~FMyThread()\n    {\n    \tif (Thread)\n    \t{\n            bool bShouldWait = false; // Will forcefully terminate the thread.\n    \t\tThread-\u003eKill(bShouldWait);\n    \t\tdelete Thread;\n    \t}\n    }\n\npublic:\n    bool Init() override;\n    uint32 Run() override;\n    void Exit() override;\n    void Stop() override;\n\nprivate:\n    FRunnableThread* Thread;\n    bool bIsRunning;\n};\n```\n\n```cpp\n// .cpp\n#include \"FMyThread.h\"\n\nbool FMyThread::Init()\n{\n    /* Should the thread start? */\n    return true;\n}\n\nuint32 FMyThread::Run()\n{\n    while (bIsRunning)\n    {\n        /* Work on a dedicated thread */\n    }\n\n    return 0;\n}\n\nvoid FMyThread::Exit()\n{\n    /* Post-Run code, threaded */\n}\n\nvoid FMyThread::Stop()\n{\n    bIsRunning = true;\n}\n```\n\nWhen you want to start your thread, include its header and call its constructor (keep the pointer at hand!):\n\n```cpp\nauto* Thread = new FMyThread( /*Parameters*/ );\n```\n\n### Tasks\n\n[TaskGraph](https://docs.unrealengine.com/5.0/en-US/tasks-systems-in-unreal-engine/), is a job manager that tries to balance out workload along multiple preexisting threads. This is ideal to send packages of small operations, as it abstracts away from you the complexity of managing threads, and also supports defining dependencies between Tasks.\n\nQueuing Tasks will not cause performance concerns due to the threads being already running, but the system may also be less reactive as it has to find slots to fit the work in inside a limited pool, and sending long Tasks should be avoided to not clog-up threads. It may also sometimes decide to run Tasks directly in the game thread, depending on the setup.\n\n#### AsyncTask\n\nIf you want to run a small async operation without creating a dedicated class or starting a new thread and do not need the control logic for pausing or callbacks, you can put it inside an `AsyncTask` running on the TaskGraph:\n\n```cpp\nAsyncTask(ENamedThreads::AnyHiPriThreadNormalTask, [this] ()\n{\n    /* Work on the TaskGraph */\n    Caller-\u003eFunctionToThread(); // Function call captured using [this]\n});\n```\n\nIf you don't know about **lambda**, then highly recommend reading about it on this [section](https://github.com/MrRobinOfficial/Guide-UnrealEngine/#-lambda).\n\n#### ParallelFor\n\nA [fancier](https://isaratech.com/ue4-improving-speed-with-parallelfor/) version of `AsyncTask` that splits a for loop into multiple Tasks running in the TaskGraph.\n\n```cpp\nParallelFor(Array.Num(), [\u0026](int32 i)\n{\n    // Run Array.Num() operations, with current index i\n    /* Work on the TaskGraph (order of execution is variable!) */\n    ++Array[i];\n});\n```\n\nThere’s no guarantee about the order or the thread safety of the operation within, so you might want to use mutexes or atomics with it. MSVC has [an analogous](https://learn.microsoft.com/en-us/cpp/preprocessor/loop?view=msvc-170) #pragma loop(hint_parallel(n)). Practically speaking, the contents of your loop must be significant to really benefit from this approach.\n\n#### FNonAbandonableTask\n\nA way to declare your own AsyncTasks, in a format that sits inbetween FRunnable and lambda-like AsyncTasks. You can implement your own code in a standalone class to be more reusable, which will run on the TaskGraph instead of inside a dedicated thread, but missing some of FRunnable’s initializing and stopping logic.\n\n```cpp\n#pragma once\n\n#include \"CoreMinimal.h\"\n#include \"Async/AsyncWork.h\"\n\nclass FMyTask : public FNonAbandonableTask\n{\n    friend class FAutoDeleteAsyncTask\u003cFMyTask\u003e;\n\n    FMyTask( /*Parameters*/ )\n    {\n        /* Constructor */\n    }\n\n    void DoWork()\n    {\n        /* Work on the TaskGraph */\n    }\n\n    FORCEINLINE TStatId GetStatId() const\n    {\n        // Probably declares the Task to the TaskGraph\n        RETURN_QUICK_DECLARE_CYCLE_STAT(FMyTask, STATGROUP_ThreadPoolAsyncTasks);\n    }\n};\n```\n\nStart your custom Task like such:\n\n```cpp\nauto* MyTask = new FAsyncTask\u003cFMyTask\u003e( /*Parameters*/ );\nMyTask-\u003eStartBackgroundTask();\n```\n\n---\n\nAs said before, Ayliroé wrote an awesome documentation on Unreal's multithreading and asynchronous tasks system, which you can read either from [Google Docs](https://docs.google.com/document/d/1uw9Dfui5ZepSrBpMc1DrxFOeRFnDu8ubzFse8Mr_s7E/) or from [Forum Post](https://forums.unrealengine.com/t/multithreading-and-performance-in-unreal/1216417/1).\n\n## 🎯 Extend Unreal Editor\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nYou can find editor icons via this [github repo, made by EpicKiwi](https://github.com/EpicKiwi/unreal-engine-editor-icons).\n\n### Slate\n\nLorem Ipsum\n\n### Creating custom asset type\n\nLorem Ipsum\n\n## ⚠️ Common Issues\n\n\u003c!-- TODO: Add more errors examples --\u003e\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n![Common Errors](static/img/Cpp_Errors.png)\n\nThere are different types of errors and issue, that you **WILL** encounter as you get familiar with programming. There are four types of category for defining an error/issue.\n\n-   Syntax - Violations of the programming language's grammar and structure rules. Every language has its own set of rules and guidelines to follow. For an example, the Python language doesn't use semicolons nor the curly braces for defining a code block.\n\n-   Linker - Issues that arise during the linking phase, such as unresolved references or conflicts between modules or libraries. A linker issue can also be very complex and hard to resolve, as it doesn't give a lot of information for you as the developer.\n\n-   Runtime - Errors that occur during program execution and cause the program to crash or behave unexpectedly. A runtime error can be resolved quite quickly, if you have access to crash reporter, which usually contains the [call stack](https://en.wikipedia.org/wiki/Call_stack) (which can pinpoint the exact function or code, which caused the crash).\n\n-   Semantic - Logical errors that occur when the code is syntactically correct but does not behave as intended or expected. A semantic error can be the hardest error to resolve, since you need to understand the code logical rather than syntactically.\n\nThe compiler will only give errors for **Syntax** and **Linker** issue. Compile error refers to a state when a [compiler](https://en.wikipedia.org/wiki/Compiler) fails to compile. Either due to errors in the code, or, more unusually, due to errors in the compiler itself.\n\nThe runtime errors can be resolved with a [crash reporter](https://en.wikipedia.org/wiki/Crash_reporter). And semantic errors can be resolved by understanding the logical reasoning of the code.\n\n\u003e [!TIP]\n\u003e If you feel stuck or can't think straight, then take a couple of minutes or even hours to do something else. Either is going outside, playing video games, listening to music or watching a film or a video. This can help you brain and rethink and resolve the issue quicker.\n\nYou can find all the compiler errors at [Microsoft website](https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-errors-c2000-c3999).\n\n### ⛔ Compiler Errors\n\nHere are the common compilation errors, that you **WILL** encounter:\n\n\u003c!-- Variable not initialized --\u003e\n\u003c!-- Incorrect syntax: ; ) } --\u003e\n\u003c!-- Different scope --\u003e\n\u003c!-- Variable not changing --\u003e\n\u003c!-- Requires an instance of a class --\u003e\n\u003c!-- Missing namespace --\u003e\n\u003c!-- Missing include --\u003e\n\u003c!-- Missing defines --\u003e\n\u003c!-- Cannot access private members --\u003e\n\u003c!-- Cannot convert type --\u003e\n\u003c!-- Wrong case --\u003e\n\n#### Compiler Error C2007\n\n**Description**\n\n\u003e No identifier appears after a `#define`. To resolve the error, use an identifier.\n\nThe following sample generates C2007:\n\n```cpp\n// C2007.cpp\n\n#define   // C2007\n```\n\nPossible resolution:\n\n```cpp\n// C2007b.cpp\n\n// compile with: /c\n#define true 1\n```\n\n[Link](https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2007) to error message.\n\n#### Compiler Error C2065\n\n**Description**\n\n\u003e The compiler doesn't recognize the identifier and, therefore, considers it undeclared. The compiler needs to be aware of the existence of identifiers before they can be used. By declaring an identifier, you provide the compiler with the necessary information about its name and type, allowing it to properly allocate memory or resolve references.\n\nThe following sample generates C2065:\n\n```cpp\n// C2065.cpp\n#include \u003ciostream\u003e\n\nint main()\n{\n    std::cout \u003c\u003c x; // C2065 error\n    return 0;\n}\n```\n\nPossible resolution:\n\n```cpp\n// C2065.cpp\n#include \u003ciostream\u003e\n\nint main()\n{\n    int x = 5; // Declare and initialize the variable x\n    std::cout \u003c\u003c x;\n    return 0;\n}\n```\n\n[Link](https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2065) to error message.\n\n#### Compiler Error C2628\n\n**Description**\n\n\u003e A semicolon may be missing.\n\nThe following sample generates C2628:\n\n```cpp\n// C2628.cpp\nclass CMyClass {} // C2628 error\n\nint main()\n{\n\n}\n```\n\nPossible resolution:\n\n```cpp\n// C2628b.cpp\nclass CMyClass {};\n\nint main()\n{\n\n}\n```\n\n[Link](https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c2628) to error message.\n\n### 💣 Runtime Errors\n\nA runtime error is a type of error that occurs when a program is being executed. It is a type of error, which is **NOT** detected at compile-time, but at runtime. It means that the code, which is being executed, is causing an error, which is not known until the program is being executed.\n\nHere is a couple of examples, of a runtime error can occur:\n\n```cpp\n\n```\n\nWithout a [crash reporter](https://en.wikipedia.org/wiki/Crash_reporter), a runtime error can be extremely difficult to resolve. As the runtime error will lead to a crash and terminate of the application.\n\nIf you can't access a **crash reporter** for debugging these errors, then use `Visual Debugger` inside VS Code or Visual Studio. This tool is designed for caching runtime errors and helping you to debug your code. It also features a [call stack](https://en.wikipedia.org/wiki/Call_stack), which can be extremely helpful for these types of problems.\n\nIf you can't access the **visual debugger**, then the most **COMMON** and **PAINFULLY** method, would be to add a print message around your code. I do **NOT** recommend this approach, since it takes more time by tracking down the function or line of code, and adding a bunch of print statements. I instead, recommend you to use either a **crash reporter** or a **visual debugger**.\n\n\u003e [!TIP]\n\u003e You can also assertions to test your code for failure. But also add message to the failure, which will be picked up by the crash reporter. This will increase understandbility, when a crash might occur. You can read more about assertions in this [section](#-assertions).\n\nFor example, if you try to access an index of an array, which is out of bounds, it will cause a runtime error, as the program will try to access a memory location, which is not valid.\n\n### 💀 Semantic Errors\n\n#### 💠 Integer overflow\n\nWhen you perform an arithmetic operation on an integer, which exceeds the maximum value that the integer can hold, the result will be an overflow.\n\nFor an example:\n\n```cpp\nint32 MaxValueOfInt32 = 2147483647;\n\nMaxValueOfInt32++; // Will cause an overflow.\n\n// Since an int32 can only store, both negative and positive: 2,14,748,3647.\n// If you only care about the positive numbers (ex: health values), then use unsigned numbers instead.\n```\n\nThe same goes for the negative numbers as well:\n\n```cpp\nint32 MinValueOfInt32 = -2147483647;\n\nMinValueOfInt32--; // Will cause an overflow.\n```\n\nTo solve this overflow issue, either use a bigger data type (`int64`). Or use unsigned data types instead, such as `uint32` or `uint64`.\n\n#### 💠 Array overflow\n\nWhen you try to access an element of an array, which is outside of its bounds, the result will be an overflow.\n\nUnreal uses the `TArray` and `TArrayView` types for arrays, and it's important to be aware of their maximum size, when accessing their elements via `[]` square brackets operation (which will get the element via index).\n\nFor an example\n\n```cpp\nTArray\u003cint32\u003e ActiveYears = { 2020, 2021, 2022 };\n\nint32 Year = ActiveYears[10]; // Will cause an overflow\n\n// Since the index is out of bounds of array's memory block and therefore cannot be accessed.\n```\n\n#### 🔍 Scope issues\n\n[Scope](\u003chttps://en.wikipedia.org/wiki/Scope_(computer_science)\u003e) refers to the region of code, where a variable is accessible. In C++, a scope is defined by \u003ckbd\u003e{\u003c/kbd\u003e and \u003ckbd\u003e}\u003c/kbd\u003e ([curly brackets](https://en.wikipedia.org/wiki/Indentation_style#C/C++_styles)).\n\nThere a three types of scopes. _Local_, _class_ and _global_.\n\n---\n\n**Local Scope**\n\nA variable is in the local scope, if it's declared inside a function or a class. The variable is only accessible inside that function or class, and not outside of it.\n\nFor an example:\n\n```cpp\nvoid KillPlayer(APlayerCharacter* Player)\n{\n    {\n        bool bIsDead = Player-\u003eKill();\n\n        // Able to access it\n        if (bIsDead)\n        {\n            PrintDeath(Player);\n        }\n    }\n\n    // Compile error! Cannot be accessed outside its defining scope.\n    if (bIsDead)\n    {\n\n    }\n}\n\n// Same goes for this function scope\n\nvoid PrintDeath(APlayerCharacter* Player)\n{\n    // Able to access it.\n    // Since, it was defined as an argument, when the function was called.\n    if (!IsValid(Player))\n        return;\n\n    // Compile error! Cannot be accessed inside another function.\n    if (bIsDead)\n    {\n\n    }\n}\n```\n\n---\n\n**Class Scope**\n\nA variable is in the class scope, if it's declared inside a class. The variable is only accessible inside that class, and not outside of it.\n\nFor an example:\n\n```cpp\nUCLASS()\nclass APlayerCharacter : public ACharacter\n{\nprivate:\n    int32 Health;\n\npublic:\n    void Kill()\n    {\n        Health = 0;\n    }\n};\n\nvoid KillPlayer()\n{\n    Health = 0; // Compile error! Cannot be accessed outside the class scope.\n}\n```\n\nHere is the fixed version:\n\n```cpp\nvoid KillPlayer(APlayerCharacter* Player)\n{\n    // Able to access it.\n    // Since, the function as defined and have correct access to the current context of scope.\n    Player-\u003eKill();\n\n    Player-\u003eHealth = 0; // Compile error! Cannot be accessed, since it requires a private scope.\n    // Meaning, the variable can only be accessed inside class scope.\n}\n```\n\n---\n\n**Global scope**\n\nA variable is in the global scope, if it's declared outside of any function or class. The variable is accessible from anywhere in the program.\n\nFor an example:\n\n```cpp\nint32 GPlayerHealth = 100;\n\nUCLASS()\nclass AMyActor : public AActor\n{\npublic:\n    void DamagePlayer(int32 DamageAmount)\n    {\n        // Able to access it.\n        // Since, the variable is defined in the global scope.\n        GPlayerHealth -= DamageAmount;\n\n        if (GPlayerHealth \u003c= 0)\n            GPlayerHealth = 0;\n    }\n};\n\nUCLASS()\nclass APlayerCharacter : public ACharacter\n{\npublic:\n    void Kill()\n    {\n        // Able to access it.\n        // Since, the variable is defined in the global scope.\n        GPlayerHealth = 0;\n    }\n};\n```\n\n## 🐣 Tips and best practices\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nHere's a video explaining some of the best practices with Unreal Engine and C++.\n\nThere is a video about some of these best practices called [Best Practices (2019-2021) from Stephen Maloney](https://www.youtube.com/watch?v=g7WVBZZTRDk)\n\nIn the video, there is also a [Google documentation](https://docs.google.com/document/d/1kIgOM7VONlPtx3WPiKdNVRYquX-GTduqSw0mU7on5h8) (if video wasn't enough) for more details about some of his tips and tricks.\n\n### Disable BlueprintPure\n\nWhen creating a `UFUNCTION` and marking it as `const`, Unreal will interpret this function as pure function. A pure function will evaluate every time it's called (inside Blueprint), compare to a regular function, which Unreal caches the result and save for later.\n\nPure function are helpful for small or quick function to execute. For an example: **getters**.\n\nWith Blueprint, every time you drag a pin from the result, the function will be evaluated every single time. And the result may differ at different execution time.\n\nThis is not the same, as a regular function. With regular function, Blueprint will then cache the result. And when dragging multiple pins from the result of the function, the same value will be used.\n\nIf you want to mark a `UFUNCTION` as const without Unreal converting into a pure function, you can add this specifier:\n\n```cpp\nUFUNCTION(BlueprintCallable, BlueprintPure = false)\nvoid ComplexFunction() const\n{\n    // Expensive calculations\n}\n```\n\n### Switch case fall-through\n\nWhen working with switch case, one benefits it's to have fall-through cases. Where, a case can fall under multiple cases and same performance.\n\nAlthough, it may be harder to read and understand this code, then doing with if-statements.\n\n```cpp\ndouble DistanceUnificationFactor(EUnit From)\n{\n    // Convert to meters\n    double Factor = 1;\n\n    switch (From)\n    {\n        case EUnit::Micrometers:\t\treturn 0.000001;\n        case EUnit::Millimeters:\t\treturn 0.001;\n        case EUnit::Centimeters:\t\treturn 0.01;\n        case EUnit::Kilometers:\t\t\treturn 1000;\n\n        case EUnit::Lightyears:\t\t\treturn 9.4605284e15;\n\n        case EUnit::Miles:\t\t\t\tFactor *= 1760;\t\t\t\t// fallthrough\n        case EUnit::Yards:\t\t\t\tFactor *= 3;\t\t\t\t// fallthrough\n        case EUnit::Feet:\t\t\t\tFactor *= 12;\t\t\t\t// fallthrough\n        case EUnit::Inches:\t\t\t\tFactor /= 39.3700787;\t\t// fallthrough\n        default: \t\t\t\t\t\treturn Factor;\t\t\t\t// return\n    }\n}\n```\n\n### 📦 Refactoring\n\nRefactoring is the process of making changes to the codebase to improve its structure, readability, and maintainability without changing its external behavior.\n\nRefactoring is an essential practice in software development that helps keep the codebase clean, maintainable, and scalable. It involves making incremental improvements to the code without changing its external behavior, which is crucial for maintaining a healthy and sustainable codebase throughout the software development lifecycle.\n\n#### Renaming\n\nRenaming members, such as variables, functions, or classes, is a common refactoring technique used to give them more meaningful and descriptive names, making the code easier to understand and maintain.\n\nExample:\n\n```cpp\n// Before refactoring\nUCLASS()\nclass MyActor : public AActor\n{\nprivate:\n    int mag;\n    float dmg = 10;\n\npublic:\n    float F()\n    {\n        mag--;\n        auto d = FMath::RandRange(0, dmg);\n        auto a = mag \u003e 0 ? d : 0;\n        return a;\n    }\n};\n\n// After refactoring\nUCLASS()\nclass MyActor : public AActor\n{\nprivate:\n    int CurrentMagazine;\n    float MaxBulletDamage = 10;\n\npublic:\n    float Fire()\n    {\n        CurrentMagazine--;\n        float BulletDamage = FMath::RandRange(0, MaxBulletDamage);\n        BulletDamage = CurrentMagazine \u003e 0 ? BulletDamage : 0;\n        return BulletDamage;\n    }\n};\n```\n\n#### Extract Method\n\nExtract Method is a refactoring technique where you take a portion of code within a method and move it into a separate method. This helps improve code readability, encourages code reuse, and simplifies complex methods.\n\nExample:\n\n```cpp\n// Before refactoring\nvoid TakeActorDamage(MyActor* actor, int damage = 100)\n{\n    // Apply damage to the actor\n    actor-\u003eTakeDamage(damage);\n\n    // Log damage taken\n    UE_LOG(LogTemp, Warning, TEXT(\"%s took %d damage!\"), *actor-\u003eGetName(), damage);\n\n    // Check if actor is destroyed\n    if (actor-\u003eIsDestroyed())\n    {\n        // Log actor destruction\n        UE_LOG(LogTemp, Warning, TEXT(\"%s has been destroyed!\"), *actor-\u003eGetName());\n\n        // Spawn explosion effect\n        UGameplayStatics::SpawnEmitterAtLocation(actor-\u003eGetWorld(), ExplosionEffect, actor-\u003eGetActorLocation());\n\n        // Play destruction sound\n        UGameplayStatics::PlaySoundAtLocation(actor-\u003eGetWorld(), DestructionSound, actor-\u003eGetActorLocation());\n\n        // Detach actor from parent\n        actor-\u003eDetachFromActor(FDetachmentTransformRules::KeepWorldTransform);\n\n        // Destroy actor\n        actor-\u003eDestroy();\n    }\n}\n\n// After refactoring\nvoid ApplyDamageToActor(MyActor* actor, int damage = 100)\n{\n    // Apply damage to the actor\n    actor-\u003eTakeDamage(damage);\n\n    // Log damage taken\n    UE_LOG(LogTemp, Warning, TEXT(\"%s took %d damage!\"), *actor-\u003eGetName(), damage);\n\n    // Check if actor is destroyed\n    if (!actor-\u003eIsDestroyed())\n        return;\n\n    HandleActorDestruction(actor);\n}\n\nvoid HandleActorDestruction(MyActor* actor)\n{\n    // Log actor destruction\n    UE_LOG(LogTemp, Warning, TEXT(\"%s has been destroyed!\"), *actor-\u003eGetName());\n\n    // Spawn explosion effect\n    UGameplayStatics::SpawnEmitterAtLocation(actor-\u003eGetWorld(), ExplosionEffect, actor-\u003eGetActorLocation());\n\n    // Play destruction sound\n    UGameplayStatics::PlaySoundAtLocation(actor-\u003eGetWorld(), DestructionSound, actor-\u003eGetActorLocation());\n\n    // Detach actor from parent\n    actor-\u003eDetachFromActor(FDetachmentTransformRules::KeepWorldTransform);\n\n    // Destroy actor\n    actor-\u003eDestroy();\n}\n```\n\n#### Typedefs\n\nIntroducing a typedef can make complex type names more concise and easier to understand. On the other hand, inline typedefs are useful for reducing the complexity of code and improving code readability by avoiding unnecessary type aliases.\n\nExample:\n\n```cpp\n// Note, this is regular raw C++ code.\n\n// Before refactoring\ntypedef std::map\u003cstd::string, std::vector\u003cint\u003e\u003e NameToNumbersMap;\n\nNameToNumbersMap numbers;\n\n// After refactoring (Introduce typedef)\nusing NumbersVector = std::vector\u003cint\u003e;\nusing NameToNumbersMap = std::map\u003cstd::string, NumbersVector\u003e;\n\nNameToNumbersMap numbers;\n\n// After refactoring (Inline typedef)\nstd::map\u003cstd::string, std::vector\u003cint\u003e\u003e numbers;\n```\n\n\u003e [!WARNING]\n\u003e Typedefs doesn't work with UHT[^1]. Meaning, you can't expose to Blueprint.\n\n#### Introduce Variable\n\nIntroducing a variable can simplify complex expressions or improve code readability by giving meaningful names to intermediate results.\n\nExample:\n\n```cpp\n// Note, this is regular raw C++ code.\n\n// Before refactoring\nfloat total = (price + tax) * quantity - discount + shippingCost;\n\n// After refactoring\nfloat netPrice = price + tax;\nfloat totalPrice = netPrice * quantity - discount + shippingCost;\n```\n\n#### Invert 'if' statement to reduce nesting\n\nConsider the following code snippet:\n\n```cpp\nvoid MyCharacter::DoSomething()\n{\n    if (bIsReadyToMove)\n    {\n        if (!bIsMoving)\n        {\n            if (!bIsJumping)\n                MoveCharacter();\n            else\n            {\n                // Handle already jumping\n            }\n        }\n        else\n        {\n            // Handle already moving\n        }\n    }\n    else\n    {\n        // Handle not ready to move\n    }\n}\n```\n\nAs you can see, the `if` blocks encompass the whole body of the method. This presents an opportunity to make code more readable by getting rid of the nested scope and adding `return` keyword[^1] as follows:\n\n```cpp\nvoid MyCharacter::DoSomething()\n{\n    if (!bIsReadyToMove)\n    {\n        // Handle not ready to move\n        return;\n    }\n\n    if (bIsMoving)\n    {\n        // Handle already moving\n        return;\n    }\n\n    if (bIsJumping)\n    {\n        // Handle already jumping\n        return;\n    }\n\n    MoveCharacter();\n}\n```\n\n### ⏱ Ticking\n\n#### For actors\n\n```cpp\nPrimaryActorTick.bCanEverTick = false;\nPrimaryActorTick.bStartWithTickEnabled = false;\n```\n\n#### For components\n\n```cpp\nPrimaryComponentTick.bCanEverTick =  false;\nPrimaryComponentTick.bStartWithTickEnabled = false;\n```\n\n#### If you have to use tick\n\n-   Set the tick interval to the maximum value you can get away with. Unfortunately this is often per frame for smoothly moving things\n\n```cpp\nPrimaryActorTick.TickInterval = 0.2f;\nPrimaryComponentTick.TickInterval = 0.2f;\n```\n\n-   Enable/disable tick to only tick when required.\n\n```cpp\nSetActorTickEnabled()\nSetComponentTickEnabled()\n```\n\n#### `FTickFunction`\n\nAbstract base class for all tick functions.\n\nSample code to get started:\n\n##### MyTickableThing.h\n\n```cpp\n#pragma once\n\n#include \"CoreMinimal.h\"\n#include \"Tickable.h\"\n\nclass FMyTickableThing : public FTickableGameObject\n{\npublic:\n    // FTickableGameObject Begin\n    void Tick( float DeltaTime ) override;\n\n    ETickableTickType GetTickableTickType() const override\n    {\n        return ETickableTickType::Always;\n    }\n\n    TStatId GetStatId() const override\n    {\n        RETURN_QUICK_DECLARE_CYCLE_STAT( FMyTickableThing, STATGROUP_Tickables );\n    }\n\n    bool IsTickableWhenPaused() const\n    {\n        return true;\n    }\n\n    bool IsTickableInEditor() const\n    {\n        return false;\n    }\n    // FTickableGameObject End\n\nprivate:\n\t// The last frame number we were ticked.\n\t// We don't want to tick multiple times per frame\n\tuint32 LastFrameNumberWeTicked = INDEX_NONE;\n};\n```\n\n##### MyTickableThing.cpp\n\n```cpp\n#include \"MyTickableThing.h\"\n\nvoid FMyTickableThing::Tick( float DeltaTime )\n{\n\tif ( LastFrameNumberWeTicked == GFrameCounter )\n\t\treturn;\n\n\t// Do our tick\n\t// ...\n\n\tLastFrameNumberWeTicked = GFrameCounter;\n}\n```\n\n\u003e [!NOTE]\n\u003e Tick any object you want, `UObject` or not!\n\n\u003e [!WARNING]\n\u003e UHT[^2] don't support exposed functions inside `USTRUCT`. However, you can still have functions inside `USTRUCT`, but not just exposed to Blueprint.\n\n### 🔌 Direct references\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nIn C++, a direct reference is a reference variable that directly refers to the memory location of another variable. When you use a direct reference, you are essentially creating an alias or an alternative name for the original variable. This means any changes made to the reference will be reflected in the original variable, and vice versa.\n\nUsing direct references can be beneficial for performance in certain situations because it avoids creating unnecessary copies of data. When you pass large objects or structures as function arguments, using direct references instead of passing by value (copy) can save memory and processing time, especially for complex objects.\n\nUsing the `const` qualifier in a direct reference serves as a safety mechanism to prevent accidental modifications to the referenced variable. When you declare a variable as const, it means that its value cannot be changed after initialization.\n\nIn some cases, using `const` in direct references can also enable certain compiler optimizations, as it provides additional information to the compiler about the immutability of the referenced value.\n\n```cpp\n// Note, this is regular raw C++ code.\n\nint a = 5;\nint b = a; // Gets a copy\n\nb = b * 2; // B = 10 and A = 5\n\nint\u0026 c = 10;\nint\u0026 d = c;\n\nd = 20; // C = 20 and D = C, which is 20\n\nconst int\u0026 e = 10; // Direct reference (use const for stopping ability to modify the variable)\nconst int\u0026 f = e;\n\nf = 11; // COMPILER ERROR!!! Cannot modify const variable!!\n```\n\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- prettier-ignore-start --\u003e\n\n## 🗝️ Deep dive\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n### K2Node\n\n\u003c!-- TODO: Write text here! --\u003e\n\nYou can read more about [K2Node by Oscar Olsson](https://olssondev.github.io/2023-02-13-K2Nodes/).\n\n### ➗ Math Expression Node\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nThe Math Expression node acts like a collapsed graph. It is a single node that you can Double-click to open the sub-graph that makes up its functionality. Initially, the name/expression is blank. Whenever you rename the node, then the new expression is parsed and a new sub-graph is generated.\n\n![Math Node Example](static/img/math_node_example.png)\n\nYou can read more about math expression node at \u003ca href=\"https://docs.unrealengine.com/5.2/en-US/math-expression-node-in-unreal-engine/\" target=\"_blank\"\u003eUnreal's docs\u003c/a\u003e.\n\n### Call function in editor\n\nExpose a function to call inside the Blueprint editor. With C++, you can mark `UFUNCTION` specifier `CallInEditor`.\n\nHere is an example:\n\n```cpp\nUFUNCTION(CallInEditor, BlueprintCallable)\nvoid DebugMessage();\n```\n\n### Call function via Console Commands\n\nIn order to call a `UFUNCTION` inside the console command, you can use `Exec` specifier. This tells Unreal Engine to add the function into the console commands list.\n\nHere's an example:\n\n```cpp\nUFUNCTION(Exec)\nvoid KillCharacter();\n```\n\nHowever, there is a downside from using this approach. Because Unreal finds the function and map to the corresponding name, Unreal cannot call multiple instances of the same function. It only prioritizes the current pawn, which is currently under possession by the player.\n\nTo call a function with multiple instances, you can type `ke * FunctionName`.\n\nHere's an example:\n\n```console\n$ ke * KillCharacter\n```\n\n\u003e [!NOTE]\n\u003e In the context of a Command Line Interface (CLI), the dollar sign (`$`) is typically referred to as a \"prompt symbol\" or simply a \"prompt.\" It indicates that the CLI is ready to receive input from the user. The specific appearance and behavior of the prompt may vary depending on the operating system and shell being used.\n\n### Renaming variables without breaking references\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nDuring development, there are occasions when you have to rename a property, function or a class. If you compile before changing the name in other location of your code, it can cause Unreal to no longer recognize existing Assets. And therefore replace with its default initialization value.\n\nTo address this issue, Unreal Engine uses Core Redirects. Core Redirects should be configured in your project's `DefaultEngine.ini` file, or, in the case of a Plugin, the prefixed, self-named .ini file for that Plugin (for example, `BasePaper2D.ini` for the Engine's Paper2D Plugin, or `Default\u003cGamePluginName\u003e.ini` for a game Plugin).\n\nIn either case, the Core Redirects will be placed in the \"[CoreRedirects]\" section. These Core Redirects will automatically remap obsolete data while loading Assets, thus preventing data loss resulting from the renaming process.\n\nHere is the following structure for a redirect of a property value:\n\n```dosini\n+PropertyRedirect=(OldName=\"CurrentClass.OldVariableName\", NewName=\"NewOldVariableName\")\n```\n\nHere's a full example of different use cases with redirects:\n\n```dosini\n[CoreRedirects]\n+PropertyRedirect=(OldName=\"PlayerCharacter.StartHealth\", NewName=\"InitialHealth\")\n\n+ClassRedirects=(OldName=\"Pawn\",NewName=\"MyPawn\",InstanceOnly=true)\n\n+ClassRedirects=(OldName=\"/Script/MyModule.MyOldClass\",NewName=\"/Script/MyModule.MyNewClass\")\n\n+ClassRedirects=(OldName=\"PointLightComponent\",NewName=\"PointLightComponent\",ValueChanges=((\"PointLightComponent0\",\"LightComponent0\")))\n\n+ClassRedirects=(OldName=\"AnimNotify_PlayParticleEffect_C\",NewName=\"/Script/Engine.AnimNotify_PlayParticleEffect\",OverrideClassName=\"/Script/CoreUObject.Class\")\n\n+EnumRedirects=(OldName=\"ENumbers\",NewName=\"ELetters\",ValueChanges=((\"NumberTwo\",\"LetterB\"),(\"NumberThree\",\"LetterC\")))\n\n+FunctionRedirects=(OldName=\"MyOldActor.OldFunction\",NewName=\"MyNewActor.NewFunction\")\n+FunctionRedirects=(OldName=\"MyActor.OldFunction\",NewName=\"NewFunction\")\n\n+PackageRedirects=(OldName=\"OldPlugin\",NewName=\"/NewPlugin/\",MatchSubstring=true)\n+PackageRedirects=(OldName=\"/Game/DeletedContentPackage\",Removed=true)\n\n+StructRedirects=(OldName=\"MyStruct\",NewName=\"MyNewStruct\")\n```\n\nYou can read more about on [Unreal's docs](https://docs.unrealengine.com/5.3/en-US/core-redirects-in-unreal-engine/).\n\n---\n\nThe `MatchSubstring` argument can be used in any Core Redirect type. If present and set to `true`, the `OldName` and `NewName` fields will be treated as substrings rather than requiring exact matches. This enables multiple matches with a single Core Redirect. In the following example, we will start with a struct and a class.\n\nOriginal code and values:\n\n```cpp\nUSTRUCT()\nstruct FMyStruct\n{\n    GENERATED_BODY()\n\n    UPROPERTY(EditAnywhere, Category = \"Documentation\")\n    int32 TestInt;\n\n    UPROPERTY(EditAnywhere, Category = \"Documentation\")\n    int32 TestIntFromStruct;\n};\n\nUCLASS()\nclass REDIRECTORSTEST_API AMyActor : public AActor\n{\n    GENERATED_BODY()\n\npublic:\n    UPROPERTY(EditAnywhere, Category = \"Documentation\")\n    int32 TestInt;\n\n    UPROPERTY(EditAnywhere, Category = \"Documentation\")\n    int32 MainClassTestInt;\n\n    UPROPERTY(EditAnywhere, Category = \"Documentation\")\n    FMyStruct TestStruct;\n};\n```\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/OriginalValues.jpg\" alt=\"Original Values\" /\u003e\n    \u003cfigcaption\u003eThis is the original code and the original set of values we're saving into our `AMyActor` Asset.\u003c/figcaption\u003e\n\u003c/figure\u003e\n\nAfter creating and saving an `AMyActor` Asset with the values shown above, we can close the Editor and alter the the code in the `.h` file and the Core Redirects in the game's `.ini` file. We will change the code to read as follows, changing the names of our `int32` properties:\n\n```cpp\nUSTRUCT()\nstruct FMyStruct\n{\n    GENERATED_BODY()\n\n    UPROPERTY(EditAnywhere, Category = \"Documentation\")\n    int32 TestInteger;\n\n    UPROPERTY(EditAnywhere, Category = \"Documentation\")\n    int32 TestIntegerFromStruct;\n};\n\nUCLASS()\nclass REDIRECTORSTEST_API AMyActor : public AActor\n{\n    GENERATED_BODY()\n\npublic:\n    UPROPERTY(EditAnywhere, Category = \"Documentation\")\n    int32 TestInteger;\n\n    UPROPERTY(EditAnywhere, Category = \"Documentation\")\n    int32 MainClassTestInteger;\n\n    UPROPERTY(EditAnywhere, Category = \"Documentation\")\n    FMyStruct TestStruct;\n};\n```\n\nWith this change, we can examine the effects of a Core Redirect, and in particular the impact of `MatchSubstring`.\n\nResults follow:\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/NoCoreRedirect.jpg\" alt=\"NoCoreRedirect\" /\u003e\n    \u003cfigcaption\u003eThe properties were renamed in code, but no Core Redirect was created. As a result, no data values have migrated to the new properties.\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/CoreRedirectWithoutMatchSubstring.jpg\" alt=\"CoreRedirectWithoutMatchSubstring\" /\u003e\n    \u003cfigcaption\u003e`PropertyRedirects=(OldName=\"TestInt\",NewName=\"TestInteger\")` causes only the two preoperties with exact name matches to migrate their data.\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n\u003cfigure\u003e\n    \u003cimg src=\"static/img/CoreRedirectWithMatchSubstring.jpg\" alt=\"CoreRedirectWithMatchSubstring\" /\u003e\n    \u003cfigcaption\u003e`PropertyRedirects=(OldName=\"TestInt\",NewName=\"TestInteger\",MatchSubstring=true)` causes all four of our properties to migrate, due to substring matching.\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n\u003e [!NOTE]\n\u003e Because `MatchSubtring` requires checking incoming Assets much more thoroughly, it can impact startup times. `MatchSubstring` is intended to be used temporarily as a fixup when making sweeping changes. It is recommended that Assets involved in these changes be resaved immediately and checked into your project's source control database with any related code changes, and that the Core Redirect be deleted without entering source control.\n\n### Sampling a curve\n\nSometimes, you probably want to work with a curve. To access a curve inside C++, you can use `UCurveFloat` class. This class gives you access to interpolated points to evaluate over a given range.\n\nYou can create them from the **Content Browser** through **Miscellaneous → Curve**.\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\nModule: `Engine`\n\nHeader file:\n\n```cpp\n#include \"Curves/CurveFloat.h\"\n```\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n```cpp\n// .h\n\nUPROPERTY(EditAnywhere)\nUCurveFloat TimeCycle;\n\nUPROPERTY(EditAnywhere, meta = (ClampMin = 0.0, ClampMax = 1.0))\nfloat TimeOfDay = 0.5f; // Range between 0 -\u003e 1\n```\n\n```cpp\n// .cpp\n\n// This will be our output value from the curve\nfloat SunIntensity = 0.0f;\n\n// Check if the curve is valid before accessing it.\n// Otherwise, if curve is a nullptr, a crash will happen.\nif (IsValid(TimeCycle))\n{\n    // We read the curve at the current level, and assign the value to MaxHP\n    SunIntensity = TimeCycle-\u003eGetFloatValue(TimeOfDay);\n}\n```\n\nYou can read more about [curves on Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Engine/Curves/UCurveFloat/).\n\n### HTTP requests\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\nModule: `HTTP`\n\nHeader file:\n\n```cpp\n#include \"HttpModule.h\"\n#include \"Interfaces/IHttpResponse.h\"\n#include \"PlatformHttp.h\"\n#include \"JsonObjectConverter.h\" // Include this, if you want to send some JSON data into the request\n```\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n```cpp\n// .h\n\nUENUM(BlueprintType)\nenum class EHTTPRequestType : uint8\n{\n    GET,\n    POST,\n    PUT,\n    DELETE\n};\n\n// Delegate for the callback\nDECLARE_DYNAMIC_DELEGATE_ThreeParams(FHTTPRequest, const FString\u0026, Result, int32 ResponseCode, bool, bWasSuccessful);\n\nUFUNCTION(BlueprintCallable, Category = \"MyPawn\")\n/**\n* Send a request via HTTP protocol system.\n*\n* @param BaseURL - Base URL on which to process the request on.\n* @param EndpointURL - Endpoint URL. Combined with base URL to get fully qualified URL for the request.\n* @param RequestType - What type of request (GET, POST, PUT, DELETE)\n* @param Callback - Callback of the request\n* @return A boolean, if the request was successfully sent out.\n*/\nbool SendRequest(\n    const FString BaseURL,\n    const FString EndpointURL,\n    const EHTTPRequestType RequestType,\n    FString Payload,\n    FHTTPRequest Callback\n);\n```\n\n```cpp\n// .cpp\n\nbool YourClass::SendRequest(\n\tconst FString BaseURL,\n\tconst FString EndpointURL,\n\tconst EHTTPRequestType RequestType,\n\tFString Payload,\n\tFHTTPRequest Callback)\n{\n    // Get a reference to the HTTP singleton and create a request object\n    const FHttpRequestRef Request = FHttpModule::Get().CreateRequest();\n\n    // Creates a lambda function and stores to a variable.\n    auto LambdaFunc = [this, Callback](FHttpRequestPtr Req, FHttpResponsePtr Res, bool bWasSuccessful)\n    {\n        FString Result;\n\n        // Check the status code\n        const int32 ResCode = Res-\u003eGetResponseCode();\n\n        if (!bWasSuccessful || ResCode \u003c 100 || ResCode \u003e 300)\n        {\n            // Only accepting 200 -\u003e 299 response code\n            Callback.ExecuteIfBound(Result, ResCode, false);\n            return;\n        }\n\n        Result = Res-\u003eGetContentAsString();\n\n        Callback.ExecuteIfBound(Result, ResCode, true);\n    };\n\n    // Bind the lambda as the callback\n    Request-\u003eOnProcessRequestComplete().BindLambda(LambdaFunc);\n\n    Request-\u003eSetURL(BaseURL + EndpointURL);\n    Request-\u003eSetVerb(UEnum::GetDisplayValueAsText(RequestType).ToString());\n\n    switch (RequestType)\n    {\n        case EHTTPRequestType::POST:\n        case EHTTPRequestType::PUT:\n        case EHTTPRequestType::DELETE:\n        {\n            // To send data into the request, you must include this header\n            // Which tells the request to expect a JSON data type\n            Request-\u003eSetHeader(\"Content-Type\", \"application/json\");\n\n            // Payload is in JSON format. Use JsonObjectConverter to convert Unreal's data type into JSON format.\n            Request-\u003eSetContentAsString(Payload);\n        }\n        break;\n    }\n\n    // Returns true if the HTTP request has started. Does NOT return the result of the callback lambda.\n    return Request-\u003eProcessRequest();\n}\n```\n\nThen you can call `SendRequest()` function:\n\n```cpp\nvoid YourClass::SendTestRequest()\n{\n    // Final URL: BASE_URL + ENDPOINT_URL = \"https://swapi.dev/api/planets/3/\"\n    // Helpful to split the endpoint, as you can switch to another endpoint.\n    const FString BASE_URL = \"https://swapi.dev/api/\";\n    const FString ENDPOINT_URL = \"planets/3/\"; // \"starships/9/\", \"people/1/\"\n\n    FString JSON;\n    FHTTPRequest Delegate;\n    Delegate.BindDynamic(this, \u0026YourClass::OnRequestCompleted);\n\n    // Send the request with delegate passed into the parameters\n    SendRequest(BASE_URL, ENDPOINT_URL, EHTTPRequestType::GET, \"\", Delegate);\n}\n\nvoid YourClass::OnRequestCompleted(const FString\u0026 Result, bool bWasSuccessful)\n{\n    if (!bWasSuccessful)\n    {\n        UE_LOGFMT(LogTemp, Log, \"The Request was not successful!\");\n        return;\n    }\n\n    UE_LOGFMT(LogTemp, Log, \"Request Output: {0}\", Result);\n}\n```\n\n\u003e [!TIP]\n\u003e You can test out HTTP request via [Postman](https://www.postman.com/) with [Star Wars API](https://swapi.dev/) example.\n\nYou can read more about [HTTP module on Unreal's docs](https://docs.unrealengine.com/5.3/en-US/API/Runtime/HTTP/FHttpModule/).\n\n### Encryption and Decryption\n\nWhen working with encryption and decryption.\n\n```cpp\n// .h\n\n// Encrypts Int32 using a 10 digit Alpha-Numeric Key into an FString\nUFUNCTION(BlueprintCallable, Category = \"Encryption\")\nstatic FString EncryptInt32(int32 InInt, FString EncryptionKey);\n\n// Decrypts an encrypted FString back to Int32 using a 10 digit Alpha-Numeric Key\nUFUNCTION(BlueprintCallable, Category = \"Encryption\")\nstatic int32 DecryptToInt32(FString EncryptedValue, FString EncryptionKey);\n```\n\n```cpp\n// .cpp\n\n#include \"Kismet/KismetStringLibrary.h\"\n\nFString YourClass::EncryptString(FString Data, FString EncryptionKey)\n{\n    FString EncryptedValue;\n\n    TArray\u003cTCHAR\u003e ValueChars = Data.GetCharArray();\n    TArray\u003cTCHAR\u003e KeyChars = EncryptionKey.GetCharArray();\n\n    for (int32 i = 0; i \u003c ValueChars.Num() -1; i++)\n    {\n        FString TempString;\n        TempString.AppendChar(ValueChars[i]);\n        EncryptedValue.AppendChar(KeyChars[UKismetStringLibrary::Conv_StringToInt(TempString)]);\n    }\n\n    return EncryptedValue;\n}\n\nFString YourClass::DecryptToString(FString EncryptedValue, FString EncryptionKey)\n{\n    TArray\u003cTCHAR\u003e ValueChars = EncryptedValue.GetCharArray();\n    TArray\u003cTCHAR\u003e KeyChars = EncryptionKey.GetCharArray();\n\n    FString OutString;\n\n    for (int32 i = 0; i \u003c ValueChars.Num() -1; i++)\n    {\n        OutString = (OutInt * 10) + KeyChars.Find(ValueChars[i]);\n    }\n\n    return OutString;\n}\n```\n\n## 🔗 Helpful Links\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\nThis section was NOT written in conjunction with ChatGPT.\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n### YouTube Videos\n\n| Author        | Title                                                                      | Length   | Link                                                   |\n| ------------- | -------------------------------------------------------------------------- | -------- | ------------------------------------------------------ |\n| Mosh Hamedani | C++ Tutorial for Beginners - Learn C++ in 1 Hour                           | 01:22:55 | [YouTube](https://www.youtube.com/watch?v=ZzaPdXTrSb8) |\n| Alex Forsythe | Blueprints vs. C++: How They Fit Together and Why You Should Use Both      | 47:13    | [YouTube](https://www.youtube.com/watch?v=VMZftEVDuCE) |\n| Alex Forsythe | The Unreal Engine Game Framework: From int main() to BeginPlay             | 27:22    | [YouTube](https://www.youtube.com/watch?v=IaU2Hue-ApI) |\n| Alex Forsythe | Multiplayer in Unreal Engine: How to Understand Network Replication        | 22:07    | [YouTube](https://www.youtube.com/watch?v=JOJP0CvpB8w) |\n| Alex Forsythe | What do you do when Unreal Editor crashes?                                 | 13:04    | [YouTube](https://www.youtube.com/watch?v=TXZGIvpEhW8) |\n| Unreal Engine | Blockout and Asset Production in UE5                                       | 34:07    | [YouTube](https://www.youtube.com/watch?v=R5TsbnW4fk8) |\n| Unreal Engine | Building Open Worlds in Unreal Engine 5                                    | 49:41    | [YouTube](https://www.youtube.com/watch?v=EEf07ggFWRw) |\n| Unreal Engine | 35 UE5 Features You Probably Don't Know About                              | 49:55    | [YouTube](https://www.youtube.com/watch?v=k2IP5DYQ0-0) |\n| Amir Ansari   | Unreal Overloaded - Soft and Hard References                               | 01:13:35 | [YouTube](https://www.youtube.com/watch?v=giDf4G6Ndk8) |\n| UNF Games     | Unreal Engine 5 Beginner Modeling Tutorial - Learn to Model Inside Unreal! | 02:12:34 | [YouTube](https://www.youtube.com/watch?v=9InU0xbX7l0) |\n\n### Articles\n\n| Author           | Title                        | Link                                                                             |\n| ---------------- | ---------------------------- | -------------------------------------------------------------------------------- |\n| Ben              | benui                        | [benui.ca](https://benui.ca/unreal/)                                             |\n| Unreal Engine    | Dev Community                | [dev.epicgames.com](https://dev.epicgames.com/community/)                        |\n| Community-driven | Unreal Engine Community Wiki | [unrealcommunity.wiki](https://unrealcommunity.wiki/)                            |\n| Jonas Reich      | OpenUnrealConventions        | [jonasreich.github.io](https://jonasreich.github.io/OpenUnrealConventions/C++/)  |\n| Oskar Świerad    | UNREAL ART OPTIMIZATION      | [unrealartoptimization.github.io](https://unrealartoptimization.github.io/book/) |\n\n### Online Tools\n\n| Author            | Title                                          | Description                                                                      | Link                                                                                                    |\n| ----------------- | ---------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |\n| Naotsun           | UnrealMacroGenerator                           |                                                                                  | [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Naotsun.Naotsun-UE-UMG) |\n| Sébastien Rancoud | blueprintUE                                    | Unofficial tool with the intent of helping Unreal Engine developers              | [blueprintUE](https://blueprintue.com/)                                                                 |\n| Matt Godbolt      | Compiler Explorer                              | Run compilers interactively from your web browser and interact with the assembly | [Compiler Explorer](https://godbolt.org/)                                                               |\n|                   | Unreal Engine 4 Console Variables and Commands | List of all UE commands                                                          | [UE Commands](https://digilander.libero.it/ZioYuri78/)                                                  |\n\n### Misc\n\n| Author        | Title           | Description                                    | Link                                                                                                           |\n| ------------- | --------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |\n| Thomas Ingram | Developer Notes | See and post notes on developer documentation. | [Chrome Web Store](https://chrome.google.com/webstore/detail/developer-notes/fchdfdnnpkphopmdaochdfnmcahndmnb) |\n\n## 🆘 Support\nIf you have any questions or issue, just write either to my [YouTube channel](https://www.youtube.com/@mrrobinofficial), [Email](mailto:mrrobin123mail@gmail.com) or [Twitter DM](https://twitter.com/MrRobinOfficial).\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003e\n\n\u003csub\u003e\u003csup\u003e\u003csup\u003eIS 14 PAGES LONG!\u003c/sup\u003e\u003c/sup\u003e\u003c/sub\u003e\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n## 📍 Footnotes\n\n[^1]: Keyword, also known as a [Reserved word](https://en.wikipedia.org/wiki/Reserved_word).\n[^2]: The [Unreal Header Tool](https://docs.unrealengine.com/5.2/en-US/unreal-header-tool-for-unreal-engine/) (UHT) is a powerful tool for managing dependencies between C++ files in an Unreal Engine project. The header tool is designed to work with the [Unreal Build Tool](https://docs.unrealengine.com/5.2/en-US/unreal-build-tool-in-unreal-engine/) (UBT), which is responsible for compiling the engine and all its modules.\n[^3]: `ASCII` or American Standard Code for Information Interchange. A character encoding standard for representing English (Latin) characters and symbols.\n[^4]: Macros in C++ are preprocessor directives that enable the definition of reusable code snippets through text replacement before compilation. Here is a [video about it](https://www.youtube.com/watch?v=j3mYki1SrKE).\n[^5]: GitHub is a web-based platform and version control repository that allows individuals and teams to collaborate on software development projects by providing a centralized location for code storage, version tracking, issue tracking, and collaboration features such as pull requests and code reviews. [Link to there site](https://github.com/).\n[^10]: [C](https://en.wikipedia.org/wiki/C_(programming_language)) is a procedural programming language known for its efficiency and portability, commonly used for system-level programming and embedded systems development.\n[^11]: [Python](https://en.wikipedia.org/wiki/Python_(programming_language)) is a user-friendly, high-level language often used for scripting, data analysis, web development, and artificial intelligence applications.\n[^12]: [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) is a high-level, object-oriented programming language developed by Microsoft, widely used for building Windows applications and games using the .NET framework.\n[^13]: [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) is a versatile, platform-independent language known for its \"write once, run anywhere\" capability, commonly used in web development and enterprise applications.\n[^14]: [JavaScript](https://en.wikipedia.org/wiki/JavaScript) is a versatile, dynamic scripting language commonly used for web development to add interactivity and functionality to websites.\n","funding_links":[],"categories":["Documents","**Unreal**"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMrRobinOfficial%2FGuide-UnrealEngine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMrRobinOfficial%2FGuide-UnrealEngine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMrRobinOfficial%2FGuide-UnrealEngine/lists"}