Back to Browse

Unreal Pointers - Garbage Collection, Smart Pointers, Class Ptr, and Soft Pointers - UE C++ Tutorial

3.2K views
Aug 2, 2025
18:09

Here we explore the various different types of pointers you can use in the Unreal Engine. Unreal engine combines a garbage collection system with a smart pointer system more common in the c++ language. It also introduces the concept of soft pointers, which reference to loading assets from disks. The goal of this video is to introduce you to all the various pointer concepts in Unreal, so that you can understand the options available to you and use the engine in c++ effectively. NOTE: the editor will load assets for you. So you should test Soft pointers in a standalone, to ensure you are properly loading/unloading things. 0:00 Reviewing Memory and Pointers 1:05 Raw Pointer vs TObjectPtr 1:51 TWeakObjectPtr vs TSoftObjectPtr 2:21 Using raw pointers and TObjectPtr pointers 2:40 Using TWeakObjectPtr 3:13 TSubclassOf pointers usage 3:30 TSoftClassPtr usage 3:40 Using "soft" paradigm to load things immediately from disk. ie LoadSynchronous function. 4:50 TSoftObjectPtr - Loading asynchronously with UAssetManager FStreamableManager 6:57 Using FStreamableHandle to ensure your memory doesn't unload 8:20 C++ Smart Pointers: TUniquePtr TSharedPtr TWeakPtr 9:11 TSharedPtr vs TUniquePtr 10:25 TSharedPtr reference counting 11:30 MakeShared vs MakeShareable 12:18 TWeakPtr demonstration 13:15 Smart ptrs vs garbage collection - the memory island issue - Memory leaks 14:01 UniquePtr demonstration - how to move unique pointers around 14:56 TSharedRef demonstration 15:21 Forward Declaring explained 17:17 Closing summary 17:50 Outro

Download

0 formats

No download links available.

Unreal Pointers - Garbage Collection, Smart Pointers, Class Ptr, and Soft Pointers - UE C++ Tutorial | NatokHD