Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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: alt text alt text

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.

Product Version: UE 4.21
screenshot-15.png (369.6 kB)
screenshot-16.png (349.0 kB)
more ▼

asked Feb 18 '19 at 08:29 PM in Blueprint Scripting

avatar image

3 2 3

avatar image Witherbrine98 Mar 12 '19 at 01:42 AM

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

alt text Nebula, thank you for your help. :)

screenshot-17.png (287.0 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Mar 11 '19 at 11:20 PM

avatar image

Nebula Games Inc
5.4k 28 9 15

avatar image Witherbrine98 Mar 11 '19 at 11:36 PM

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?

avatar image Nebula Games Inc Mar 11 '19 at 11:41 PM

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.

avatar image Witherbrine98 Mar 12 '19 at 12:02 AM

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.

avatar image Nebula Games Inc Mar 12 '19 at 02:08 AM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question