My function in C++ doesn't appear into blueprint, I can't use it

I want to create a C++ function that can then be used in my blueprint, as if it were a basic blueprint function.

In the .h file I called it like this:

and in the .cpp it’s like this:

I compile, close, and open the project in Unreal, but when I search for it with the right mouse button, it finds nothing… why?

When compiling in Visual Studio there are errors, but not related to my function, there were already some errors just after opening Visual Studio without me having written anything of my own… I don’t know if this could be the problem or not, but if so, why are there already errors?

EDIT: I adopted the “classic solution” of @IrSoil

and payed attention to do all of things correctly, with the help of @Chatouille and @3dRaven, but nothing changed. Only after the restart of the pc the function appear in the blueprint… IDK why, but now it’s appeared. So, thanks all

Are you writing your code in a main module or are you making a plugin? Your code seems fine for main game code, but for a plugin you should at least make sure it’s enabled in your project.

Can also suggest to try the classic solution for a lot of ue’s weird problems:

  1. remove “binaries”, “intermediate”, “saved” folders from your project
  2. regenerate *.sln
  3. “rebuild all”
    Usually it doesn’t really help, but sometimes it does

Ignore/disable this Errors List tab and look at the Output tab instead.

image

1 Like

Did you add ProceduralMeshComponent module into your build file to PublicDependencyModuleNames?

Also start errors usually indicate the the project needs a rebuild.

1 Like

Yes it’s for the main game… I try this classic solution but nothing

@Chatouille Okay thanks, the output of compilation it’s all okay

@3dRaven

I think yes:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.