First, we need to make a target that knows when it has been shot and can announce it to the game.
Create the Blueprint: Right-click in your Content Browser, select Blueprint Class, choose Actor, and name it BP_Target.
Add a Mesh: Open BP_Target, click Add Component, and add a Static Mesh (like a sphere or a cube) so you have something to shoot at. Make sure it has collision enabled (BlockAllDynamic is usually fine).
Create an Event Dispatcher: Look at the bottom left panel (My Blueprint). Under Event Dispatchers, click the + icon and name it OnTargetHit.
Script the Hit Logic: Go to the Event Graph. Depending on how your gun works, you’ll want to trigger the next step when the target is shot.
Use Event Hit.
Call the Dispatcher: From your Hit or Damage event, drag off the execution pin and search for Call OnTargetHit.
Destroy the Target: After calling the dispatcher, add a Destroy Actor node so the target disappears when shot. Compile and save.
Drag three of your BP_Target actors from the Content Browser into your level viewport.
Drag whatever actor you want to act as the wall into the level (this can just be a basic Cube from the Place Actors panel, or a custom Blueprint).
Now, we will use the Level Blueprint to listen for the targets, count the hits, and destroy the wall.
Open the Level Blueprint: On the top toolbar, click the Blueprint icon and select Open Level Blueprint.
Create a Counter Variable: In the bottom left panel, click the + next to Variables. Name it HitCounter and change its Variable Type to Integer. Compile the blueprint so its default value is 0.
Reference the Actors: * Go back to your main Level Viewport and select all three BP_Targets.
Go back to the Level Blueprint, right-click in the empty graph, and select Create references to 3 selected Actors.
Do the exact same thing for your Wall actor (select it in the viewport, right-click in the Level Blueprint, and create a reference).
Bind the Events:
Create an Event BeginPlay node.
Drag off one of your target references and search for Bind Event to OnTargetHit. Connect this to Event BeginPlay.
Repeat this for the other two targets, chaining the execution pins together so all three get bound when the game starts.
Create the Counting Logic:
On the Bind Event nodes, you'll see a red square pin named "Event". Drag off one of these pins and search for Add Custom Event. Name it UpdateTargetCount.
Connect the red "Event" pin from all three Bind Event nodes to this single custom event.
Increment and Check the Math:
From the UpdateTargetCount custom event, drag out and create a Set HitCounter node.
Drag your HitCounter variable onto the graph as a Get, add a + (Add) node to add 1 to it, and plug the result into the Set HitCounter node.
Drag off the Set node and create a Branch (Hold B and left-click).
For the Branch condition, check if HitCounter is >= (Greater or Equal) to 3.
Destroy the Wall:
From the True pin of the Branch, drag out and create a Destroy Actor node.
Plug your Wall reference into the "Target" pin of the Destroy Actor node.