C++ cannot get FUNCTION to show up in blueprint in editor

I’ve implemented a very simple getter method on the CharacterController in C++.
The character controller has UCLASS(Blueprintable) attribute already and the character blueprint is that which was generated from a C++ startup template.

If I add UPROPERTY’s to the class in C++, they do show up just fine.
However, no matter how I tag my function in the class, it does not show up anywhere on the blueprint in the Editor after recompile and hotload.
It simple does not show up in the blueprint’s functions list and the category is also not added.

I’m running everything on a Macbook Pro. I have heard that Mac version has some bugs, but I’m hoping this is simply just me missing how to do it correctly.

Here is the basic declaration which by all accounts in documentation and examples should work if I wish to implement a method in C++ and have it callable from the blueprint in the EventGraph of the editor?
The following compiles just fine, but nothing ever shows up on the blueprint in the editor:

/** Get a commodity item from the inventory if it exists. */
UFUNCTION(BlueprintCallable, Category="Inventory")
AItem* GetCommodity(const FString& name);

I have found that new functions in classes require you to close and restart the Unreal Editor before they are seen in blueprints.

Heard about that. I did try that a few times before I posted this question but no joy here.

Is the class definition marked as a UCLASS() ?
Is there the GENERATED_BODY() or GENERATED_UCLASS_BODY() line in the class definition?

Yes to both questions. :slight_smile: I mentioned that is has UCLASS(Blueprintable) at the top of my original post above as well.

Maybe its not public: ? Not sure if that matters.

Another idea:

Have you tried to uncheck “Context sensitive” in the blueprint editors context menu?

At least for me… sometimes functions dont show up when it is enabled.

Yeah, it’s all public. I’m going to try redoing all this under Windows and see if the problem is just gone… I cannot see anything wrong.

Arg. So first, you are correct! As soon as I turn off Context Sensitivity in the Event Graph menu, my C++ functions show up as selectable in the right click menu. However, as you can see in this screen capture, in the MyBlueprint menu, my functions STILL do NOT show up. :frowning:

Also in the screen shot below is a simple test ToggleLight void function I added in C++ as well. Again, it does not show in the MyBlueprint tab, but does show up in the context menu with Context Sensitivity turned OFF.

If I create the same function using the Blueprint Editor, the function shows up just fine in the MyBlueprint tab. What gives…

Seems like an editor bug to me.

After installing on Windows and repeating the same exercise, the behavior is the same as above. I don’t understand why the functions don’t show up in My Blueprint tab.

That was the solution in my case. thanks

I’m having this same problem at random and it is incredibly frustrating. Anyone have a solid workflow for working with C++ and Blueprints? It seems like if you make a mistake or don’t do things exactly the right way getting things to work again becomes an unneccessarily awful and time consuming chore. None of my functions seem to appear in the BP editor at all even after restarting the editor, rebuilding the project, regenerating the solution, and doing anthing else I can think of.

I have Bluepintable and BlueprintType in my UCLASS macro and BlueprintImplementableEvent and BlueprintCallable *as well as a Category specifier) in my UFUNCTION macro. I am completely at a loss as to how I’m supposed to extend a C++ class as blueprints and override a parent function when the results I’m getting are so counterintuitive.

It appears that if you change anything in your header file, you need to restart the editor, but actual code changes can hot reload.

Hi Silverleaf1,

I know this answer is delayed but the way that you would make the function show up here would be to replace

UFUNCTION(BlueprintCallable, Category="Inventory")
 AItem* GetCommodity(const FString& name);


UFUNCTION(BlueprintNativeEvent, Category=“Inventory”)
AItem* GetCommodity(const FString& name);
AItem* GetCommodity_Implementation(constFString& name);

And then define the implementation function instead of the actual function itself. This would cause the function to be visible in the Functions tab of the blueprint editor under the ‘Overridable’ drop down. Also remember that with context sensitivity on, if a function requires a variable to be passed into it (Like your function expects a FString) it will only show up if you’re dragging a pin off an FString variable.

Hope this helps, have a nice day!

That works most of the time. But sometimes it doesn’t. Trying to recompile parent classes and all sorts of other things and sometimes they pop up and sometimes they just don’t…

You don’t need to restart Unreal Engine!

The thing is the compile in VisualStudio doesn’t affect the Blueprints. You need to press compile in the engine, not in the visual studio.

You don’t need to restart Unreal Engine!

The thing is the compile in VisualStudio doesn’t affect the Blueprints. You need to press compile in the engine, not in the visual studio. When you restart the engne it will compile it again, that’s why it will work.

Other than I posted this in 2015, you have to read the question more carefully. I was adding new C++ code which was callable from blueprints. I was not creating new functions in level script (blueprint only).
The correct answer is still the one given by Epic staff back then.

I read the question carefully and I had the same issue. I was adding new c++ node which was callable from blueprints. You can try restarting engine, who cares.

yeah ali even restarting the editor didnt fix it for some reason. i had to compile in the editor to fix the same issue i had. i guess the solution is to try both!! :slight_smile:

thanks for both of your replies. :slight_smile: