Download

Differnce between this and GetOwner()

Hey there , really quick one . What is the difference between “this” and “GetOwner()” function?

The owner is generally the object that “owns” the current object, whereas “this” is the object running the current function.
For example, inside a Component of some sort, “this” will be the UComponent, but GetOwner() will be the AActor.
Note that GetOwner() isn’t available in all classes, only classes that have explicitly defined an ownership model in code.
“this” however is part of the C++ language.