I am making a maze game with secret walls that I want to be destroyed when a certain score is reached. I currently have a fully working game where I can pick up objects, track my score, and then end the game and take me back to the main menu when all items are picked up. What I want to do is change the game so when a score is reached, the wall disappears and the map can be extended in that direction. However, I can't seem to figure out how to get the wall to be destroyed. I believe I may not be referencing it correctly in C++ code, but can't find a way to do it correctly. Anyone see what I'm doing wrong?
I should also mention that I DO NOT have a C++ file for the BP_SecretController. I tried making one, but couldn't figure out how (Don't remember how I did it with the others because this is an old project and I'm jumping back into UE4 for the first time in months).
FinalGameModeBase.cpp
if (Score >= 12.0f)
{
BP_SecretController2->DestroyComponent();
}
FinalGameModeBase.h
UPROPERTY(EditAnywhere, Category = Building)
UStaticMeshComponent* BP_SecretController2;