# How can I fix this relatively simple code?

**URL:** <https://forums.unrealengine.com/t/how-can-i-fix-this-relatively-simple-code/2693663>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [January 20, 2026, 6:22pm UTC](https://forums.unrealengine.com/t/how-can-i-fix-this-relatively-simple-code/2693663 "2026-01-20T18:22:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![UkkosDuck](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UkkosDuck](https://forums.unrealengine.com/u/UkkosDuck)\
**Post date:** [January 20, 2026, 6:22pm UTC](https://forums.unrealengine.com/t/how-can-i-fix-this-relatively-simple-code/2693663/1 "2026-01-20T18:22:22Z")

</div>

Hello! So I’m trying to make a lava room, where the player is held in a box with invisible walls until the sound is over, after that the walls would dissapear and XXX things would happen.

How can I make it so the walls I put (Blueprint Actors that are invisible walls) would disappear after the sound is over?

Here is my attempt at making it work.  
Any help is appreciated!

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/6/5/1658cc9122e6d52ad3ccf31fe6396bddfc41e079.png)

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [January 20, 2026, 9:16pm UTC](https://forums.unrealengine.com/t/how-can-i-fix-this-relatively-simple-code/2693663/2 "2026-01-20T21:16:02Z")

</div>

Hey @UkkosDuck !

If this is on the Level Blueprint, you would just add each lava wall as you did here and give each of them a “Destroy Actor” node.

Alternatively you could use “Make Array” and plug each wall into that, save that array as a variable, then on custom event use “ForEach” with that plugged in and a “Destroy Actor” node after that with the object passed through! 🙂

Hope that helps!

---

<div class="post-metadata">

**Author:** ![BRGEzedeRocco](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brgezederocco/32/1216890_2.png) [@BRGEzedeRocco](https://forums.unrealengine.com/u/BRGEzedeRocco)\
**Post date:** [January 20, 2026, 9:19pm UTC](https://forums.unrealengine.com/t/how-can-i-fix-this-relatively-simple-code/2693663/3 "2026-01-20T21:19:38Z")

</div>

Hello @UkkosDuck ,  
You could do something like this  
This setup plays an audio when the actor starts and removes the invisible walls once the audio finishes.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/e/f8e257c2e47d91ea07a6e60e06878fb4c29d7ea4.jpeg)

If you use **OnComponentBeginOverlap** , it’s important to **cast to the Character** that enters the collision to make sure only the player can trigger it.

The logic would look something like this:

- **OnComponentBeginOverlap**
- **Cast to the player Character**
- If the cast is successful:
  - Immediately disable the trigger’s collision (so it doesn’t trigger again)
  - Start playing the audio

- When the audio finishes:
  - The **On Audio Finished** event is executed
  - The walls are disabled (or any other logic you need is executed)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/2/2e25e9144b2ef32304825bfd40d7ed6275679f2c.jpeg)

Hope it helps!

---

<div class="post-metadata">

**Author:** ![Wayne\_Tang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wayne\_Tang](https://forums.unrealengine.com/u/Wayne_Tang)\
**Post date:** [January 22, 2026, 9:33am UTC](https://forums.unrealengine.com/t/how-can-i-fix-this-relatively-simple-code/2693663/4 "2026-01-22T09:33:58Z")

</div>

it’s not good that drive event by sound

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [February 2, 2026, 11:39pm UTC](https://forums.unrealengine.com/t/how-can-i-fix-this-relatively-simple-code/2693663/5 "2026-02-02T23:39:44Z")

</div>

Did you ever get it figured out, @UkkosDuck ?

Let us know how it’s going! And if you got it figured out, let us know for future answer seekers! 🙂

---

<div class="post-metadata">

**Author:** ![lAvArt-Studio](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lavart-studio/32/1143413_2.png) [@lAvArt-Studio](https://forums.unrealengine.com/u/lAvArt-Studio)\
**Post date:** [February 2, 2026, 11:52pm UTC](https://forums.unrealengine.com/t/how-can-i-fix-this-relatively-simple-code/2693663/6 "2026-02-02T23:52:26Z")

</div>

> [@UkkosDuck](#):
>
> So I’m trying to make a lava room, where the player is held in a box with invisible walls until the sound is over, after that the walls would dissapear and XXX things would happen.
> 
> How can I make it so the walls I put (Blueprint Actors that are invisible walls) would disappear after the sound is over?
> 
> Here is my attempt at making it work.  
> Any help is appreciated!

Have you considered driving the event using Blueprint Interfaces or event dispatchers? I’m not sure if it’s a very clean way to handle such logic directly in the OnAudioFinished delegate, I mean, you’d have to iterate over the walls array you mentioned but that’s not shown in your snippet, just something to think about here that might be useful.
