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"

SetDefaultSubobjectClass when calling Super's constructor crashes Unreal Engine

Hello everyone!

Today I started a new project, after creating the base classes a compile step made Unreal Editor crash. Since then my project doesn't start, at 70% load Unreal Engine stops working. After a bit of fiddling, cleaning the build, deleting some of the folders inside of the intermediate folder, etc. I couldn't get it to work. No big deal, something got corrupted when it crashed and I can't get back in, it's early in the project, I will waste more time trying to solve the problem than starting from scratch.

So I started a new project and when I finished redoing the last class that I managed to do in the previous one the compiler crashed again. Apparently it's my code that somehow manages to crash the compiler, and I guess when the project begins it rebuilds some things and so it crashes too.

Indeed when I comment everything out except the topmost definition of the class and the GENERATE_BODY() macro the project starts properly.

By uncommenting slowly and recompiling I've delimited the problem to the constructor of the class:

http://lpaste.net/2836142406502449152

The three lines inside are not needed to crash the compiler so I've left them commented.

The class declaration is as follows

http://lpaste.net/429630822773948416

Product Version: UE 4.13
Tags:
more ▼

asked Oct 26 '16 at 07:16 PM in C++ Programming

avatar image

asm
1 1 2 3

avatar image Doug E ♦♦ STAFF Oct 26 '16 at 07:57 PM

Hey asm-

If I understand correctly, the crash is happening with/without the three lines that are currently commented out. If that is the case, then it appears to me that the crash is caused by what is happening in your Super call of the constructor. You can test this by commenting out the call to the Super and attempting to compile again. t appears that the Super is trying to set a movement component that was defined in the parent class, can you load the project through Visual Studio debug mode and confirm that Super::MovementComponentName is valid.

avatar image asm Oct 26 '16 at 09:10 PM

Hello Doug, Super::MovementComponentName seems to be valid, to test it I did:

 FName test = Super::MovementComponentName;
 auto a = test.ToString()

The result is: alt text

Without the auto a = test.ToString() test is invalid tho. I guess the compiler just removes it as it is not being used?

avatar image Doug E ♦♦ STAFF Oct 27 '16 at 02:48 PM

Did you see if the crash occurred with the Super() call commented out? Can you also provide the callstack and log files from the crash as well as the ASpectatorPawn parent class? From what I can tell it appears the parent class has declared a movement component that is being defined through your child class. If having the body of your AArgalisPlayerPawn constructor be empty causes the crash, then the creation/assignment of the movement component seems to be the most likely cause. Since you mentioned copying classes to a new project, can you provide any classes related to your PlayerPawn class and SpectatorPawn class?

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

1 answer: sort voted first

Hey asm-

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Cheers

Doug Wilson

more ▼

answered Nov 04 '16 at 02:36 PM

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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