UFUNCTIONs randomly disappearing

I’m currently getting some very odd behaviour where blueprint-exposed UFUNCTIONs in multiple unrelated classes will randomly disappear after adding additional ones and recompiling. The methods are nowhere to be found in the right-click menu of the Blueprint, and generate a large amount of Blueprint compilation errors wherever these methods have been referenced:

http://pastebin.com/47sLQRRN

Even stranger is, if I add a completely empty UFUNCTION method to one of my classes like so:

// MyClass.h
UFUNCTION(BlueprintCallable, Category = "Dummy")
void DummyMethod();

// MyClass.cpp
void AMyClass::DummyMethod()
{
    // This method literally does nothing, but adding it magically makes phantom methods reappear across my project.
}

All of the phantom methods come back when I compile again. This leads me to believe there’s a bug in UnrealHeaderTool somewhere that’s throwing off the parsing of these methods.

In instances where the methods are missing, I have tried compiling with the editor closed, open, old binaries deleted, and so on. The only thing that seems to work is changing the number of UFUNCTIONs that exist in my project. EDIT: Sorry, this actually only happens when I compile with the editor open. Everything is fine if I compile with the editor closed.

If there’s any info I can provide to reproduce this issue, let me know.

Well you need to figure how to reproduce it, we know as much as you do, maybe posting whole header file will help out. Also did you check the palatte tab, it is more reliable then right-click

The bit about reproducing was referring to sending code to Epic staff confidentially. Even if I were to change my class/variable names, it’s still not really practical as the problem seems to occur sporadically across several unrelated classes.

I checked the palette tab and the functions still aren’t anywhere to be found, but that’s no surprise since the unchanged blueprints referencing them can’t find them either.

Hey -

More information will be needed to understand this problem and being able to see the code you’re using would help. Are the functions that go missing declared with the UFUNCTION macro and BlueprintCallable specifier? If a function does disappear does creating a new blueprint of the same type allow for the function to be called?

Cheers

reproduceing means when bug is predictable writing down steps how to cause a bug so it’s easier to find a cause

Hi ,

Upon closer inspection, the methods that go missing seem to be the same two each time. One of them is a regular method that is not overridden by any subclasses, and the other is a virtual method with a default implementation that is extended (i.e. overridden, but Super::MethodName() is called in the body) in all of its subclasses.

Both problematic methods are declared with the UFUNCTION(BlueprintCallable) macro. I’ve just noticed that the overridden versions of the functions don’t have the macro above it, which I only did to match other overridden methods (BeginPlay(), Tick(), etc.), which aren’t given macros when you generate the class. Could this be part of the issue?

The declarations for the problematic methods is as follows:

// Problematic method 1: DHPlayerController.h
UFUNCTION(BlueprintCallable, Category = "DH Player Controller")
void Focus(AInteractiveObject* Object);

// Problematic method 2: InteractiveObjectState.h
UFUNCTION(BlueprintCallable, Category = "Interactive Object State")
virtual void Enter();  // has default implementation in base class, can be overridden in subclasses

// Problematic method 2A: InteractiveObjectStateSubclass.h
void Enter() override;

Contrary to what I said in the original question, this issue actually only occurs on hot-reload compilation and is fine when I compile with the editor closed.

I just copied the base class macro for Enter() to all subclasses, but this doesn’t fix the issue.

Hey -

I added the first two functions you posted and compiled (hot reload). After making sure that they showed up in the right click menu of my blueprint I then added a third function to the class and compiled (hot reload) again. When the compile finished I was still able to find the Focus() and Enter() functions in the right click menu. Is there something else that I’m missing in my steps? Are you able to reproduce this problem in a new project without any additional content?

Hey -

We’ve not heard from you in a few days. I will be marking this post resolved for tracking purposes but if you are still having problems with your functions appearing in the blueprints feel free to comment to reopen the post. Please let me know if you’ve been able to test the steps mentioned in my previous comment and the results you got.

Cheers

Hi ,

Sorry for dropping off. I suspect this will be a more difficult bug to track down than just extracting those methods into a clean project, as there’s really nothing extraordinary about the methods themselves. If I figure out what combination of circumstances has led to the errors, I’ll post again, but for now I’ll just close the editor when I need to compile.