I want to execute the Construction every time I change a Variable. It works fine in BP but in C++ it doesn’t.
The C++ Version of the Code is not working
USPatrolComponent::USPatrolComponent()
{
if (bVisualize)
{
bVisualize = false;
ShowPath();
}
}
But in BP it works
When does the Visualize path variable become true?
By manually setting it. Its intended as EditInstanceOnly bool.
The construction script in C++ is only run when the object is first created. You’ll need to implement the PostEditChangeProperty function for your object to get it to mimic what you are doing in blueprint. Check out this link for an example: How do I use PostEditChangeProperty? - C++ - Unreal Engine Forums