Null Pointer at World.h 3080
So this is a funky error. I have a first person controller that i'm working on and i'm getting a weird null pointer error.
So I usually make my controller the default pawn so I can use a player start object but sometimes I want to put the character into the world and have it auto possess player 0. That way I can initialize variables that are in the world. However, with this controller, when I use auto possess and set it to player 0, it throws a null pointer exception and crashes the engine. Here's my cpp file and here's my header file
I've tracked the error to line 213 in the cpp file. Without that line, the code works but with it, it throws the null pointer exception. The problem is the line has nothing to do with pointers. It's a line that assigns a boolean variable. When I debug, I can trace the null pointer to World.h line 3080, where this is the command
Now I don't know enough about the engine source code to know why that is happening or what this line means. The thing is I haven't edited the engine code so it must be with my code but it's hard to debug when the exception location has nothing to do with the line of code that causes it.
I should add that this happens in 4.13.2 as well but I am using 4.14 right now.
Anybody have any ideas?
asked Nov 26 '16 at 06:44 PM in C++ Programming
Follow this question
Once you sign in you will be able to subscribe for any updates here