How to use/retrieve APlayerController [noob question]
First of all im a complete newbie and I basically dont know what the f I am doing in my life. So yeah basically I want to check whether a key is being pressed/was pressed.
I was planning on using APlayerController::IsInputKeyDown (EKeys::Key); but I dont know how to get the current 'APlayerController'.
asked Aug 27 '17 at 06:25 PM in C++ Programming
If your doing singleplayer only, I believe its something like this
Or I believe UGameplayStatics::GetPlayerController(GetWorld(), 0);
With any world action you should double check its valid first so I would guess -
Update: Oh and just a handy tip if your new to C++. Get a copy of Unreal source code from github or just have github open on the UE page. If you want a function like getInput, run a search on github for that, and you can check how epic implement it. This is basically how I do all my coding.
answered Aug 27 '17 at 07:14 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here