Why am I getting an error of "______ should not be called from a Blueprint" when I restart the Editor?

After struggling with this issue regarding my project I decided to submit my question to propper assistance. I created this Blueprint consisting of a Box for simple Overlap Events. This Blueprint acts as my Area Volume ( ICON_Area ) and its function is to store variables and gameplay elements for a particular area inside the level. In this particular case, a Variable Array called RegisteredPlayerStart.

My PlayerStart ( a Blueprint with a cylindrical mesh) on BeginGame event checks for any ICON_Area that it’s overlaping and try to add itself to the RegisteredPlayerStart Array.

When the player Dies, he will respawn in some PlayerStart found in the ICON_Area’s RegisteredPlayerStart Array. For that, before the SpawnActor command
I check if we should use Ramdon Respawn points or Linear Respawn points and then, from my PlayerController, I Call a function inside the ICON_Area to select a PlayerStart.

Everything works fine until I restart the editor… Everytime the Editor opens I get the following error:

LogBlueprint:Error: [compiler] Error Function ‘ICON_SelectNextPlayerStart’ called from ICON Select Next Player Start should not be called from a Blueprint

LogBlueprint:Error: [compiler] Error Function ‘ICON_SelectRandonPlayerStart’ called from ICON Select Randon Player Start should not be called from a Blueprint

If I recompile the Blueprints everything start to work again aside from trying to play as StandAlone Game, which crashes on StartUp.

The Function “ICON_SelectNextPlayerStart” and “ICON_SelectRandonPlayerStart” are inside my ICON_Area but is called from my PlayerController blueprint.

My Player is a Ball that uses a peculiar gravity logic and, in order to do so, I need every ball used by the player is registered inside a Array, So I can pass any command related to
every ball that belongs to the player. So, on Begin Game, every spawned ball adds itself to an Array in the PlayerController, for that I have a function, inside the PlayerController called
“ICON_RegisterBall” and, when the ball is destroyed, “ICON_UnRegisterBall”.
Before the Update to the 4.1 version, these last two functions worked fine, but now they show an error on Editors start up and, as the first issue above, as soon I Recompile the blueprints,
everything starts working again.

LogBlueprint:Error: [compiler] Error Function ‘ICON_RegisterBall’ called from ICON Register Ball should not be called from a Blueprint

LogBlueprint:Error: [compiler] Error Function ‘ICON_UnRegisterBall’ called from ICON Un Register Ball should not be called from a Blueprint

Everything I’m trying to do with the Blueprints, was done before with UDK and UScript. I’m just trying to port my work to Unreal 4. So far I’ve managed to get things working
and I’m really impressed with the quick results I’m getting with the Blueprint System, aside for these problems when I restart the Editor or try to play the game as a Standalone.

Screeshots:

Blueprint error at Editor Startup

Function declaration:

Thanks in advance for the help.

I had a similar issue going from the Beta to 4.0. I toiled with it for a while and the only thing that worked was rebuilding the bluepritns from scratch :confused: Luckily my blueprints weren’t horribly complicated to begin with.

have you tired making a copy/duplicate of the Blueprint and seeing if that ‘holds’ the compiling?

Hi , in fact I did copied/duplicated the blueprints more than once (on of the first approaches I took). I also tried to restart all the programming from scratch, but the problem eventually poped in after a while and in randomic form.
I noticed that after renaming and recompiling everything seem to work for some time but, again, just for a little while. Based on the behaviour and the random nature of these occurences I can only assume that this is an engine bug, though no one from Epic staff has given me any answer yet. Any thoughts?

I’m getting this issue as well from a Blueprint that’s basically not been changed. However I DID make a MINOR change to the blueprint a few days ago. I moved a node in the blueprint. Now it fails the ‘raw’ compiling (It compiles fine if I open the BP and hit compile).

Reverting to previous versions that didn’t trigger the error doesn’t seem to help. Luckily, I don’t need these particular blueprints anymore, but This is a real issue if it were to happen to my active code!

here’s the Log line and Diff:

LogBlueprint:Error: [compiler] Error Function 'FindNextgate' called from  Find Nextgate  should not be called from a Blueprint

This isn’t a really comprehensive answer as it doesn’t explain why this seems to crop up out of nowhere, but it’s a workaround.

The way i fixed it, rather than rewriting my classes was to replace the function calls with Custom Event calls that simply activate the functions:

I am also getting this error. Another work around is to rename the function, compile it, save the whole thing and then reload.
It seems to work again (albeit with some console spam about the names not matching) until something else gets changed.

Thanks for the reply.

Renaming the function was my workaround as well.

I tried everything I could think of. Starting the class blueprint from the scratch, reinstalling the engine, pasting the same blueprint in another project, programming a new blueprint in a new project, but I always end up getting this issue (related to comunication between blueprints).

Renaming the function, compiling, saving all and restarting the editor until there is no more errors was the only workaround I’ve found to keep working…

I’m having this issue also. Originally I wasn’t calling a function from another blueprint, but was instead trying to read the contents of an array. This would compile fine in the editor, but every time I exited everything and restarted the editor it would break, fail to compile and pins would get disconnected. I thought I’d created a temporary fix by creating a function that returned the array that I could call instead of trying to access it directly, but as soon as I made another change to the blueprint I started to get this error.

While I’m glad that some people have been able to find workaround that fit their particular scenario, I’d really like to get a better answer for this.

Does anyone else think it might be related to the engine trying to compile blueprints in the wrong order when starting play? I have a somewhat complicated set of dependencies for my blueprints right now, to the point where I assumed this problem was my fault for quite a while before modifying things to the point where the blueprint making the function call is not referenced by any other blueprint in the game and should be fine to compile last.

Hi Kaonashi,

Have you tested this issue in the most current engine version (4.6.0)? If the issue is still present, please let us know and we will try to help you find a solution.

Thanks,

TJ

Unfortunately, it is still a problem.
I’m creating a blueprint only game, and this error message keeps popping up in 4.6.1.
I’ve tried a bunch of things to work around, but the only solution that seems to have worked is creating an event that then calls the erronious function. Still not 100% reliable, though.

Hi WDIScottC,

So far I haven’t been able to reproduce this error in-house. If you have a reliable way to reproduce it, could you post some steps-by-step instructions and screenshots for us?

Or if you have a self contained asset that produces this error, please feel free to upload it here or PM me a download link on the Forums.

Hi WDIScottC,

We haven’t heard back from you in a few days, so we are marking this post as resolved for tracking purposes. If you’re still experiencing this issue, please feel free to post back here with additional information.

Cheers,

TJ

I had the same issue with UE 5.3.2 and fixed it.

Short answer: function was missing BlueprintCallable specifier but it was visible in the BP code. Adding the missing specifier fixed the issue.

UCLASS()
class UDTS_API UUDTSWaitForTrafficEvent : public UBlueprintAsyncActionBase
{
	GENERATED_BODY()
 
public:
	// Will keep listening to the Traffic Event until the traffic rule is finished.
	UFUNCTION(Category="UDTS|Traffic", meta=(DefaultToSelf = "TrafficRule", HidePin="TrafficRule"))
	static UUDTSWaitForTrafficEvent* WaitForTrafficEventTrigger(const UUDTSTrafficRule* 
	
	...
	
};

Event though I forgot to add the BlueprintCallable specifier, I could call the function from BP and that was throwing the same error. I don’t know why a function which is not exposed to the BP can be called like this. Maybe there is a bug in the engine?