[C++] How do you get APlayerController from ACharacter?
I have been looking for resources on obtaining APlayerController from ACharacter. So far, I see a few questions about enabling input, and answers to those questions saying to override SetupInputComponent method.
But I don't see how to get APlayerController from ACharacter, even though ACharacter should be able to retrieve APlayerController in some way.
Does anyone know how to do this, and if possible, explain it in detail? Thanks in advance.
asked Mar 22 '15 at 05:26 AM in C++ Programming
I haven't tried this with the default APlayerController, I'm using my own APlayerController(named ATBPlayerController) and get it like this in the ACharacter class(named ATBCharacter)
this works for me(with a custom PlayerController)
But, ACharacter also has an Controller variable, this variable should be the controller/playercontroller which possesses the ACharacter, so this should work if u are using the default one.
answered Mar 22 '15 at 09:47 AM
answered Apr 08 '18 at 10:40 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here