How can I make a raycast have a trail effect?

1: How would you make your raycast / linecast have a trail effect. I was thinking a ribbon trail but that is for actual physical projectiles, How could you apply it to a raycast.

2: I’ve tried making a beam particle with this tutorial. A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums But I don’t quite understand how to hook it up to a raycast in blueprint. I tried setting the source and endpoint when that actor spawns but it seems like it is to late because its already set to null source and end point. I’ve also tried just updating it in the blueprint beam event graph and it doesn’t work.

3: I could just use a cylinder and extend it to the hitpoint of my raycast, but how would I add a particle effect on the cylinder , kind of like that beam tutorial ? Is that possible, if so how.

Thanks in advance.

I think you want to look into particle effects.

Yeah the beam particle has a source and end point but I cant figure out how to set it to my raycast.

By raycast you mean a line trace? You are using vectors to determine the start and end of the line trace, can you not use the same vectors for the beam?

Yeah i tried using the same vectors for the beam it doesn’t work, i think its because i have to set them after i spawn the particle effect. actually the beam start and end points need some index also, I just don’t know how to use them 100% correctly. I think ill just have them already in the scene and turn them on and off.

That could work. Then you just update their vectors as needed. But it could get crowded if you have a lot of actors that can shoot beams I think.

I wish I could give you better advice, but I haven’t delved too deep into the particle emitters yet.

I found out i can expose a variable in the class im spawning before spawn, and send that data into the particle class before it spawns, but the vectors i sent 1 works and the other just gets sent to some arbitrary same point probably 0,0,0. What are the correct functions for setting the beams? I used set beam source point and set beam end point but one of these is not correct or something. What are the correct functions to set the target and source of the beam?

There isn’t really a correct function. Just a matter of properly doing the math to get each vector.

One vector will probably be your character or some point on/near him.

The other vector will be the target.

For my trace Vectors, I get Playcontroller, Convert Mouse Location to World Space, use World Location for the Start, and then Add World Location to World Direction for the end point.

I find that you can spawn a fast traveling projectile that looks like a tracer or has a particle attached. Just be sure to make it so it destroys on impact, or after a certain time so it doesn’t make your game have lag.