x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

I want to make a bomb script

So i'm making a maze game with puzzle elements being the main point and one area is bombs. I want to use the bombs so that they explode after interacting with them after pressing e. I also want to make it so bombs can explode a certain type of static mesh and only that static mesh. The only problem is that i have no idea where to start or how to even add particles to a model. Any assistance would be greatly appreciated and if any info is needed, just ask.

Product Version: UE 4.20
Tags:
more ▼

asked Dec 03 '18 at 12:15 PM in Blueprint Scripting

avatar image

Gaemzal
1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

You can start with setting an explosion radius for a bomb (a float variable within the bomb blueprint).
Then there are 2 ways:
1. You destroy every mesh of a certain type in the area, regardless if they are covered by something.
2. You only destroy meshes that are not behind any covers.

In the first case you can find all the meshes within the radius (I'd set respective tags for the Meshes, like "Destructable"): and then you Find All Actors With Tag "Destructible" -> Foreach Loop -> If Get DIstance To < Explosion Radius -> Destroy Actor. (Alternatively, you can set a Sphere Collision with the respective radius, and then Get Overlapping Actors -> Foreach -> If actor has tag -> Destroy)

In the second case I'd use Trace By Channel to find those Destructible meshes in multiple directions with the Trace length equal to the Explosion Radius, and destroy the meshes the trace hits (the same, checking the Actor Tag), but if it hits the obstacle, the meshes behind it are not destroyed.

P.S. It's a good thing you added he word "script" at the end of the title =)

more ▼

answered Dec 03 '18 at 12:44 PM

avatar image

Tuerer
1.8k 12 7 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Had to throw off the FBI somehow and thanks.

more ▼

answered Dec 03 '18 at 01:12 PM

avatar image

Gaemzal
1 1

(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