Initializing a PlayerController in my character's constructor crashes the editor
I know there are no syntax errors here, so i must be breaking some rule.
I have this:
in my constructor for a default pawn. For some reason the client crashes every time I run this. What am I doing wrong?
The reason the crash is occurring is the call to GetWorld(). It is attempting to get the game world which doesn't exist when the game isn't running. If you move that line of code to BeginPlay() instead, you can avoid the crash. Another good idea is to check for the game world prior to making the call. If you add
answered Jul 26 '16 at 06:17 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here