Download

Lightsaber

I saw the new Star Wars movie and played some Jedi Knight 2 again and thought I’d try to make a lightsaber in UE4 as just a bit of fun.

It’s got:

  • a glowing retractable blade
  • animTrail emitter for more impressive visuals in motion
  • attached light
  • changeable colour with 1 variable
  • emissive burn marks on walls that fade away
  • particles of burnt stuff when hitting something

I used a placeholder character I’d done previously for something else that already had some sword animations and put a couple in just to show off motion. But I guess the only non-obvious part of how it’s done is the wall decals part, for which I don’t just put in the decals at every line trace location per frame, but I add the locations to an array and then calculate how far apart two successive points are and split the difference several times and add in additional decals if the points are far enough apart. That creates a more consistent line at lower framerates, although still not the ideal solution. Originally I wanted to use much fewer decals and stretch them between two successive line trace hit locations, but I couldn’t figure out the right vector math to rotate them correctly. (I really don’t like 3 dimensional vector math.)

Oh and the material for the decals looks a bit like this:
fad04dba9e70b439db590d9de0c485547f10df41.png

The top half gives it a breathing effect (although it’s hard to notice with the relatively fast fade away) and the bottom half makes it fade out over time, so there’s no instant disappearing. Also I noticed that small decals fade away really quick when you move away from them, so I used a small white circle on a big black background for the opacity so it would be “bigger” and be visible from further away.

hahaha nice one XD, you could make some emmision of particles on contact with surfaces :slight_smile: (well I mean it could be tweeked some more :slight_smile: and the sound xD could make it more TADA)

liking your lightsaber too I am;).

Do want :smiley:

Ok now that is cool!

That is just awesome on every level. Reminds me of the effect they used in Jedi Outcast II I believe it was but way better. Awesome work man.

This is awesome. I enjoyed that in the JK games as well. Nice work. =)

Nice!
Definitely reminds me effect from JK :slight_smile:

Someone asked if I could share this and I have no plans for it, so I figured why not.
The project is done in 4.10 and the files are zipped up with 7zip. Here’s a link to it: LightsaberProject.zip - Google Drive
It’s messy and partially commented, but it shouldn’t be too hard to figure out.

I think the only controls are these, if you can’t find them in the character BP: Left mouse + ctrl/alt/shift for attacks. Spacebar and hold for jump. 1 for turning on the blade. 2 for changing colour. 9 for options, 0 for show fps.

How did you Animate the retractable Blade? I cant find it in the project.