[c++] [bp] Why, when my Actor component is changed in c++, on a recompile, it cannot be accessed in blueprint?

Hi everyone,

I have an actor component (let’s call it UAttachmentComponent) that is attached to a cube actor.

AttachmentComponent = CreateDefaultSubobject<UAttachmentComponent>(TEXT("Attachment Component"));

This is all handled in c++. I also have some code in blueprints, all my UI for example, and whenever I recompile after changing the actor component code the blueprint code cannot find any variables or functions in the actor component.

For example; say I have a function that is void UAttachmentComponent::Equip(){All the equip code}. And I change it to say

 UE_LOG(LogTemp, Warning, TEXT("WOOT!"));

Every instance of my AttachmentComponent, in my blueprint classes and UI, can no longer find the Equip function. It always reads

Could not find a function named “Equip” in ‘AttachmentComponent’.
Make sure ‘AttachmentComponent’ has been compiled for Equip

and in the widget itself (called AttachWeaponsInterface) there is an error

[1374.57] Compile of AttachWeaponsInterface failed. 5 Fatal Issue(s) 0 Warning(s) [in 269 ms]

On an engine reset everything is fine again, no errors, no problems, and all my changes have now compiled.

My guess is that there is something wrong with “Hot compile” but that should mean that rebuilding from the editor should work, but it doesn’t.

If anyone has any suggestions on how to compile the actor component with the rest of the code that would be great. Any other workarounds would be appreciated.