Say, I have a Character class can be possessed by both AI and human player.
I have some C++ code to spawn and modify UI widget for some scenarios like changing weapon icon when weapon changed, setting up the crosshair for different weapons. Of course, when a character possessed by AI doing something like this, I don’t want to run the UI-related code.
What’s the proper way to separate the UI code from the character? Do I need to create custom PlayerController or something? How to determine if a character is controlled by AI or player properly?