GetOwner/GetWorld

What would you say, If you should make a detailed explaination what is GetOwner() and GetWorld()? I confused a bit.

GetOwner() returns the owning actor for that actor or component. For an actor that would be whatever you set that to, it will be nullptr if you don’t. An example of setting that would be for a gun to have the character that equips it to be the owner.

For components that would be the actor its attached to.


GetWorld() returns the current world in which actors and components will live in.

Ok, now got it. Thanks a lot :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.