How to EnableInput() Through code? how to reference the PlayerController?
This function requires reference to Player Controller. In BP you have a node for getting current PlayerController. How do I do the same thing in code? and why do I even need to reference a PlayerController to enable input? I just want to program some input.
asked Nov 06 '14 at 08:27 AM in C++ Programming
I Found the answer on some vague forum thread.
first you define a BeginPlay(), why is it virtual for I dont know.
then you EnableInput() and they way to get the PlayerController is to say GetWorld()->GetFirstPlayerController() and that gets you the Controller.
DO NOT, ever try to do this in the constructor or else Unreal 4 will crash and your project will be lost forever.
Follow this question
Once you sign in you will be able to subscribe for any updates here