Break Blocks in Multiple Hits (Solved)

I need help: I’m trying to make it so make it so a block is replaced with another when I overlap with it.

Here’s the blueprints I’m using:

When I hit overlap with the boxes, they just destroy, but disappear entirely. Nothing replaces it like I want it. It’s supposed to go:

BreakableBlockStronger → BreakableBlockStrong → BreakableBlock

Thank you in advance.

Nice points. I’m thinking that maybe change it so instead of destroying the actor itself before spawning the weaker block, I just toggle visibility and collision?

A couple issues I see here. First, when you overlap the first box, it would spawn the second box and destroy itself. The second box when you overlap it however, would destroy itself FIRST and never spawn the final block. “Destroy” is always the last thing a blueprint will do. So anything after a “Destroy” node won’t get executed. That is the issue between block 2 and 3. But I can already guess that overlapping block 1 would destroy everything because you are spawning block 2 directly where block 1 and (I assume) the player is still located. Thus, as soon as block 2 is spawned in, the player overlaps that, it is destroyed instantly and never spawns block 3 due to the previous issue. Even if it did spawn block 3, you would overlap block 3 instantly after block 1 and 2 and it would also be destroyed. Thus, you only ever see block 1.

It isn’t an issue of the visibility/collision of the prior block it is the fact that the newly spawned block is immediately “overlapped” and thus thinks it should execute its script to spawn the next block and destroy itself. What you need to do is prevent the player from immediately overlapping the new block. Not sure how your game mechanics are but if you want to simulate the player “breaking down” a wall or something don’t let the player fully overlap the wall and thus end up in a position to instantly overlap the newly spawned block. You have to have the player prevented from moving into the space where the wall spawns or delay the player’s ability to interact with the wall until a second or so has passed so you actually “see” the second wall before destroying it.

I see. Now then…I have to temporarily take away the player character’s collision the moment it overlaps with the wall’s box collision. But do I cast the wall to the player character, or the other way around? I’ve been learning a bit of Unreal 4, but took a bit of a break and now I got a bit rusty, so I’m trying to refresh.

I figured it out, with a little help both on here and irl. Here’s the resulting Blueprint:

Nebula, thank you for your help. :slight_smile:

I would cast from wall to player. You don’t want to clutter the player BP with every possible object you can interact with. If you need some refresher videos this playlist may help you. I also have one on collisions too if you have trouble setting that up.

Unreal Engine 4 Beginner Tutorials: https://www.youtube.com/playlist?list=PLyu-W38DvZhqByAoeva1jewB5s78zQHIy