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"

HDY enable collision in a particle system? Only emitter collides, not the particles

Hello,

I have a simple 2D game and I've created a particle system under the form of a beam. Now that beam is basically a laser. The emitter source is a simple cube for now and so is the target. I have set a 'delay' before the 'enable emitter' node so that the laser beam appears when I need it to.

My problem is that I cannot for the life of me figure out how to make the actual beam 'particle' detect a collision with any of my characters. The emitter itself or the target (both cubes) do detect the collision, but the particle effect, the laser beam itself does not detect any. I have fiddled with the collision presets - tried dynamic, pawn, vehicle etc. but none worked. Is it necessary that the beam itself should be a mesh first of all? that would undoubtedly detect a collision just as any other object. Thank you!

Product Version: UE 4.17
Tags:
more ▼

asked Jan 23 '19 at 04:03 PM in Blueprint Scripting

avatar image

OutOfRehab
7 1 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

You have to do that on tick. Set a Line Trace from the first cube towards the second, and check if it hits something. Or Multitrace, depending on how you want it to act.

more ▼

answered Jan 23 '19 at 04:10 PM

avatar image

Tuerer
1.7k 10 6 8

avatar image OutOfRehab Jan 23 '19 at 04:41 PM

Ok so I have followed you and the line trace does work. I do have a problem though -

So the line trace detects both characters, but I want the one character that crosses the line to be slowed. Now, how do cast to both of them if that makes sense, or how do I make it so that the one crossing the line is affected, no matter which one out of the 2 characters. If I cast to one of them, only that one will be affected. But I don't know how to cast to both of them in this situation. Check the screenshot. I basically need a target for both 'character movement' and 'hit actor'.

alt text

ue4-linetrace.png (282.5 kB)
avatar image Tuerer Jan 23 '19 at 04:55 PM

That's exactly what MultLine Trace is for. It's virtually the same, but returns all the actors between Start and End. alt text

trace.png (81.5 kB)
avatar image OutOfRehab Jan 23 '19 at 05:29 PM

Hey thank you again,

I did as you said but now something weird is happening. The multi + for is ok (added custom event because ForEach hates delays), but there's something wrong with the character index.

In this situation P1 gets affected, but P2 doesn't? If I plug the Player Index to ForEach's Array Index, then when P1 crosses the line both characters are affected and vice-versa, with P2 not going back to normal speeds ever. It's so confusing, that is.

alt text

multi.png (186.0 kB)
avatar image Tuerer Jan 23 '19 at 06:10 PM

You have to use the Break Hit Result to get actors (Hit Actor pin), and not Get Player Character, because like this you set parameters to only one of them.

avatar image OutOfRehab Jan 23 '19 at 06:16 PM

So then how can I possibly make the transition from the 'Hit Actor' pin to the 'Character Movement' pin, because 'C Movement' pin is asking me for a target - which would be the 'Hit Actor'.

avatar image Tuerer Jan 23 '19 at 06:56 PM

You can either Cast it to your character class, alt text

Or use a Blueprint Interface, and set all those functions in the Character BP, and then just call them by an Interface Message.

trace.png (106.7 kB)
avatar image OutOfRehab Jan 23 '19 at 08:33 PM

I have got 2 different characters. I would have to use two casts - cast on char 1 then cast on char 2, which won't work. I can either cast it to Player 1 or Player 2.

I have no experience using Blueprint Interfaces. Like, at all.

avatar image Tuerer Jan 23 '19 at 09:00 PM

You can Cast to both: Cast to the first one, and then use the Cast Failed output to Cast to the second.

As for Interfaces, look up some tutorials; Interfaces are a quire powerful instrument that can save you a lot of time and performance.

avatar image OutOfRehab Jan 27 '19 at 05:30 PM

Thank you and sorry for the late answer, been caught at work for the past days. Any way to disable the line trace and activate it whenever I decide to? Or make it ineffective or something of sorts?

avatar image Tuerer Jan 27 '19 at 06:45 PM

If you use it with a timer, you can Pause/Unpause Timer by Handle; if you use tick, you can either disable/enable tick; if tick is used for something else, just place a branch with a bool just before the Line Trase.

(comments are locked)
10|2000 characters needed characters left
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