Blueprint loses C++ function reference when opening project

Hi guys,

one thing is bothering me lately: Whenever I start my UE 4.18 Project with the Unreal Editor, it’s giving me compiler errors in a blueprint where I use 2 functions of a C++ class, all other functions are fine.
When I try to create a new node of the function it is not found, but if I change just a comment or anything so the c++ class is updated to unreal again I can refresh the nodes manually and they work again.
This happens everytime I load the project.

It’s this set function and the related get function getting broken on startup

// .h file

public:	

	//Set SubEffector
	UFUNCTION(BlueprintCallable)
		void SetSubeffector(FTransform transform);

	//Get SubEffector
	UFUNCTION(BlueprintCallable)
		FTransform GetSubeffector();

// .cpp file

void ARobotArm::SetSubeffector(FTransform transform) {
	FVector Arm5_Desired =  transform.Rotator().Vector() * Arm5_Length;
	EffectorTransform = FTransform(FRotator(0, 180, -90)) * (transform * FTransform(Arm5_Desired));
}

FTransform ARobotArm::GetSubeffector() {
	return FTransform(FRotator(Theta6, 0, 0)) * poseableMesh->GetBoneTransformByName(boneNames[5], EBoneSpaces::ComponentSpace);
}

Anyone else having this issue?

PS:
I’m also having the bug with visual studio opening multiple times. In detail, I open a c++ class in the unreal editor and one instance of visual studio 2017 opens right up like it should do, but the message “Loading Visual Studio” in the lower right corner of the unreal editor remains with the loading animation still running. After a few minutes another instance of visual studio 2017 and an instance of visual studio 2015 pop up. But I think it doesn’t have anything to do with the above issue, since hot reload works with the visual studio instance which opens instantly.

Hey there, the Loading Visual Studio is a known bug, should be fixed in 4.19. Can you show the code surrounding that node?

Sure, but I don’t know if this’ll be of much help.

On Visual Studio, with Editor closed, right click your game project (not engine project) then click ‘Cleanup Binary Files’ context menu button…
After cleaning is complete, build the game binaries on Visual Studio (Development Editor Win64).
Open the Editor, delete that node and compile Blueprint, then add a new instance of the node to the graph.

Now stop using hot reload :slight_smile:

1 Like

I found the solution so in case anyone else needs it the setting to enable is “Force Compilation at Startup” under “General - Loading & Saving” → “Startup”

1 Like