0
\$\begingroup\$

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;

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ No ideas for this? I've still been trying to figure it out, I just can't seem to find what I'm doing wrong. \$\endgroup\$ Commented Oct 8, 2017 at 1:31
  • \$\begingroup\$ Not knowing much about unreal or game development in c++, i notice it says "destroy component" in your script. In unity and c# you would say destroy gameobject. \$\endgroup\$
    – user106170
    Commented Oct 31, 2017 at 16:23

0

You must log in to answer this question.

Browse other questions tagged .