[HELP] Unreal Engine C++ class not saving/compiling changes after reopening project

Hi everyone,
I’m having a strange issue with Unreal Engine and a custom C++ class I created (a class library with static functions). Here’s what’s going on:


The Problem:

  • I created a C++ class (let’s call it MyGameplayFunctions) with some static functions.
  • I compile the code in Visual Studio → then click “Compile” in Unreal Engine → everything looks fine at first.
  • BUT when I close Unreal Engine and reopen the project:
    • My newly added functions are gone or not recognized in Blueprints.
    • The class seems to revert to an older version, like it never saved the changes.

Packaging Error

When I try to package the project for Windows, I get an error like:

bash

CopiaModifica

Could not find a function named "SetVariableaDuringGameStaret" in 'BP_PlayerMani'

This is a Blueprint node calling one of the functions I added. The function existed before I closed UE5, but now it’s gone from the engine’s view.

What’s strange is:

  • My very first test function in that class (which takes a string input) still works fine and can be packaged.
  • All functions added after that are not detected anymore.

What I Tried

  • Rebuilding the solution in Visual Studio.
  • Compiling in UE5 after changes.
  • Deleting Intermediate, Binaries, and DerivedDataCache folders before reopening.
  • Checking Build.cs to ensure the class is in the right module.

What could be causing this?

  • Why does the engine “forget” the newer functions?
  • Why is only the first function retained, even though the class compiles fine?

Any advice or pointers would be super appreciated! Thanks in advance

Please provide the header file in question, either via screenshot or pasted as “preformatted text”, and a screenshot of the call site (in the blueprint graph I presume).

Hello, I found the solution!
Basically, I set the startup project to compile all my classes.
I don’t know why, but for some reason Unreal Engine 5 wasn’t remembering the files and classes I had created before closing it.
I fixed it by enabling auto-compilation when opening UE5.
Now everything works fine, and I’m also able to create the build package to play the project outside the editor.