x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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

 return (OwningGameInstance ? OwningGameInstance->GetTimerManager() : *TimerManager);

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?

Product Version: UE 4.14
Tags:
more ▼

asked Nov 26 '16 at 06:44 PM in C++ Programming

avatar image

john.kinzel
1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question