Hi, I was wondering if anyone knew how to make lightsaber collision effects like the ones seen in combat in the movies or when you slash walls in the games like Jedi Academy, and if someone knows if they could share how to do that, I'm using ue4 4.17

I need to know how to make lightsaber effects using blueprints in 4.17

I use the marker → to show a path to another place. Example: Content Browser → Add New

You can add a collision capsule to the saber around the blade part, and when it hits walls, you can line trace to check the material of the wall. Then you can make switch node and spawn a decal on the surface that was hit that changes based on the surface type. Also, while adding the decal, you can add an Emitter at the location of impact using the line trace and angle it towards the player using the FindLookAtRotation node, again, with the trace.
Here is a more in depth breakdown for the answer:

[First, I would recommend that you give my answer on this question a look.][1] It goes over creating Weapons and how to do it so you can easily edit weapons and create new variants.

A Switch node takes in an input in the style of an enumerator ([follow this link to learn about enumerators in a YouTube video][2]), and returns which is selected. For example, let’s say that you have multiple surface types: Glass, Metal, Wood, and Plastic. A switch would input PhysicalMaterial (which will return a list of all of your created physical materials, more on that below), then have an Execution pin for every physical material. This way you are able to use it like a branch with multiple True and Falses, making it easier and more organized when you need to get a large list of things and do something different for each one. For some more information on [PhysicalMaterials and how to make, use, and edit them, follow this link][3].

Create a physical material for each of those the same way that you would an actor by going Content Browser → Add New → Blueprint Class → PhysicalMaterial.




Once you have created all of the materials you want, go to your lightsaber actor blueprint. In the blueprint, click on Add Component → Capsule Collision. This Capsule Collision is how your weapon will know when you hit something, and to tell the player, you can use a Cast to node. Cast to the player, and for the input use Get Player Character (if you created the player as a character, if you made it as a pawn when selecting the Blueprint Class, then use Get Player Pawn). You could right click in the event graph for the player character and click on Create Custom Event. Name the event Weapon Hit. In the lightsaber event graph, right click and Cast to Whatever you named your player blueprint and trigger the event you made called Weapon Hit; then attach whatever you want the player to do (ex. give health or xp for hits) to the output pin. [For more information on Casting, please follow this link.][5]

Below on the right is where you will find how to create a new PhysicalMaterial, and on the left is how to add the collision you will need.




Now that you have your physical materials, you will need to create them in the engine itself, and then set the engine PhysicalMaterial to the actors you made. See below how to do this.

On the left and top, you will have to add each of the materials that you have made to the PhysicalMaterials list under Top Bar → Edit → Project Settings → Physics, then scroll to the bottom. Replace from top to bottom the Nones, but only the ones you need for now. Once you have done this, these will not appear where we need them until you close and restart the engine editor. Once it is restarted, move to next step.

The bottom portion of the image is showing you how to setup the last bit. Open each of your PhysicalMaterials that you created in the very beginning, and look in its details pane. You will see Surface Type; change that from Default, to the corresponding title of the Surface Types you added in the end.




Below you will see how to change paths depending on what surface is hit. I am not very good with decals, so please reference the link at the bottom of this answer for more on those.

[Learn more about Decals and how to use them here.][9]

[Learn more about Particle Systems and how they work here.][10]

[Learn more about Raycasts (line traces) and how to use them here.][11]

Please let me know if this update gets you headed in the right direction :slight_smile: Best of Luck!

I’m fairly new to unreal engine so a more in-depth answer would be helpful please, thank you for your help

I went ahead and updated my answer! Hope it help!

It sounds like a more advanced version of the spray paint tutorial on the Unreal tutorial videos.