I’ve recently been having a problem relating to changes in C++ code not being reflected in the Blueprints that inherit from it. I have been defining Overlap events in C++ in order to create a pickup class. However, whenever I make a change to the Overlap event, the changes are not reflected in the Blueprints after I compile the code. Instead, I have to delete the Blueprint class and remake it, which is a very slow process. Is there a way to refresh the Blueprint class to make it see the changes, or do I need to keep remaking the Blueprints every time?
Yes, this is a problem i run into as well.
any suggestions anyone ?
Try this with the blueprint open: File-> Refresh All Nodes
Any updates?
Did my suggestion below not work for you?
Unfortunately, didn’t ( I have a UPawnSensingComponent in my C++ Class-Actor, and the last update with adding to it a new delegate to the event OnSeePawn didn’t effect to an old Blueprint class, which inherits from the C++ Class.
PawnSensingComp->OnSeePawn.AddDynamic(this, &AFPSAIGuard::OnPawnSeen2);
I’ve used a lot of methods, including your (thank you for your suggestion), but, only recreating Blueprint class helps me ( it’s very annoying.
I have same problem with 4.19.2. I don’t want to recreate my blueprints.
I solved this problem in this way : RMB on blueprints → Asset Actions → Reload.
Problem still here in 2022. Classy
Problem still here in 2023 and with UE5.
There are a lot of tricks to solve this but sometimes none of them are working so you’re forced to create a new blueprint from your cpp class in order the changes to take effect.
Good luck if you need to change your constructor code after the very first version of your cpp class.
In my case I’ve only added the overlap handling for an UBoxComponent (the common
OnComponentBeginOverlap.AddDynamic(…)).
Impossible to refresh the existing blueprint with this addition, need to create a new one, this is a nonsense and I’m sure that I’m doing something wrong but what? Id dont’ know, I’ve tried it all [1] becasue I don’t want to create a new blueprint child class from scratch, but nothing works. Creating a new BP child class works, the new class has the overlap behaviour, but this is not an acceptable solution to me, can’t believe that there’s no other option.
[1] Things that I’ve tried so far (over 10 times each):
- Close the editor and rebuild the solution from visual studio (Development Editor).
- Delete the folders Binearies and Intermediate.
- RMB on the blueprint class > Asset Actions > Reload.
- Re-parent the blueprint class with the c++ class from the blueprint editor.
- Pledge god that if this time works I’ll assist to church next sunday (tried various gods and rites and a vast combination of them just in case god X wants me to land a tree and Y prefers goat sacrifices).
Edit:
Ok did another run adding binding in c++ after the creation of the blueprint.
OverlapBox = CreateDefaultSubobject<UBoxComponent>(TEXT("Overlap Box"));
OverlapBox->SetCollisionProfileName("OverlapAll", true);
OverlapBox->SetupAttachment(GetRootComponent());
OverlapBox->OnComponentBeginOverlap.AddDynamic(this, &AMyActor2::OnOverlapBegin);
OverlapBox->SetGenerateOverlapEvents(true);
UpdateOverlaps(true);
UpdateOverlaps(true);
works.
It seems to enforce it to reevaluate the overlap volumes.
You can call it once and then comment it out. Only needs to be re-evaled once if the overlap is added later. No need to waste cpu cycles on each construction.