I am having a lot of trouble trying to figure out what my problem is. My code compiles successfully within Visual Studio, but the changes that I make to my code are not appearing in-editor. For example, I changed some of my variables from the uproperty VisibleAnywhere to EditAnywhere, but in the editor they are still showing up as greyed-out boxes that I cannot change (I had heard hot reload is finicky with header files). I also added an OnClicked function to a skeletal mesh, but this function is not being called when I do click on the skeletal mesh, and I have a feeling it is due to the changes in code not being reflected in the editor.
I have tried deleting the visual studio project file, the intermediate folder, the binary folder. I tried opening visual studio from the editor after generating project files, but that didn’t work either. I have even cloned the repository from github hoping that it would fix the issue, but it did not. I am not sure if this is a hot reload issue, but any help would be greatly appreciated.
edit: So on second look at my code, I determined why the editor was not updating the variables I changed, and it was simply because I declared an instance of the struct containing those variables with VisibleAnywhere, so of course they would not be editable. But, I am still having difficulty with the clicked events. The definition of the function in my .h file is this:
UFUNCTION()
void OnClicked(UPrimitiveComponent* ClickedComponent, FKey ButtonPressed);
And in the constructor in the .cpp file,
UnitSkeletalMesh->OnClicked.AddDynamic(this, &AUnitBase::OnClicked);
And the actual function:
void AUnitBase::OnClicked(UPrimitiveComponent* ClickedComponent, FKey ButtonPressed)
{
UE_LOG(LogTemp, Warning, TEXT("In OnClicked."));
}
Any help with this problem is very welcome.