UE get player controller
Then you don't need to iterate through all of them. For example if you are in a Singleplayer Game. |
Depends on what you want to do and where you want to do it. The main way you'd do this is here.
Some things have the owner variable as a Clients only have 1 controller, their own. Servers have ALL controllers. You'll want to use |
I see, thank you very much :)
Out of curiousity, does GetWorld()->GetFirstPlayerController() do the same thing?
Yes, it gets the player controller with index 0.
Yes, but it takes less code (look at implementation). Also it doesn't check if the World is Null (because it's a Worlds method obviously (only for your consideration).