So I’m trying to attach a trail renderer to an object that is a child of the sword bone/joint. And when I play the animation the trail turns out to be very jagged instead of smooth. I have tried reducing the min and max vertex distance, the angles, but it still gives me the same result.
What I’m getting:
VS what I’m supposed to be getting:
I tried using the unity wiki trails like the trailArc, TimeBasedTrail etc but they also give me the same jagged, unsmooth result. I would really appreciate some help on what I’m doing wrong here
Now I could be wrong and please correct me if so, but something tells me that the reason this is happening is because of the animation inside of unity editor? Because in the animation importer the animation looks smooth and goes at 1 frame at a time yeah, but inside the editor it skips frames and thats probably what causes the trail renderer to jump and create straight lines instead of smooth trail.
Animation importer preview SMOOTH:
Clicking the step button which is supposed to skip one frame at a time NOT SMOOTH AND JUMPS FRAMES:
I have searched all over to understand what I’m doing wrong. Would really appreciate the help. Thanks in advance.
Intresting problem. im not sure where you have ‘max’ and ‘angle’(maybe i dont remeber right), but did you try to put min very low as 0.01 ?
Also you can see that your animation is running smooth over time but it is still normalize to the frames(counter on the buttom) so your viewport show the right imported animation.
As Ludvig I wouldn’t bother with the default in this case. I had neat results with this one, allows you easily to integrate a custom material which you can animate using the vertex colors.
I agree with you actually ^^ sometimes it feels that they made unity unfinished product in purpose, so there will be a reason for the asset store. In the new 5.5/5.6 it looks like its becoming a better package but still , you know… what da faq unity. I like unity more then unreal in the work flow but hate the functionality in comparison.
Thanks for your reply mate. I did come across this yesterday but I thought I was doing something wrong and figured I’ll give it a try besides paying for it. Will be sure to add it to my collection whenever I have the $$
Min Vertex Distance: Never make segments shorter than this Max Vertex Distance: Never make segments longer than this Max Angle: Never make angles between segments greater than this. Increasing it will make a faster but uglier line.
But tweaking them did not help either. Also, did you mean that the frames when I hit the step button are correct? If so would there be a way to smooth it out in the viewport or is there no need for that with smoother trail obviously.
@RyanB Thanks for your advice. I’m assuming Ludvig’s and Dom’s links are some of the free options out there. Will be sure to update when I can try it out.
I would love to help you further. I guess I will learn something new out of it as well ^^. if you would like to share with me your project file, I will have a look.
Your animation preview is interpolating between the 14 frames to give you smooth playback. It’s filling in extra frames to give the illusion of smooth playback.
Your editor is not interpolating between frames. It’s just drawing the frames as is, step by step.
The trail renderer draws frame to frame. So, in your editor, it draws segments between frame 1 and frame 2, frame 2 and frame 3, etc. The tip of the sword is in one position on frame 1 and another position frame 2 and the trail renderer draws a segment between those two points: a straight line. Repeat. The trail renderer doesn’t automatically bend, it is always a straight segment between those frames.
As a test, slow down your animation to something like 60 frames and see how much smoother it is.
You really want something that can “bend” or look like it’s bending between frames. A spline could do that.
This trail renderer is designed specifically with melee trails in
mind. It will track the path of its parent object and create a fluid
arc between its saved points. You can set the distance between saved
points, which gives you control over the accuracy of the interpolation.
Increasing distance will produce more smoothed out arcs, where reducing
distance will increase accuracy to the actual path.
Thanks for all your replies. I tried @Dom’s pocket trails as well as @RyanB’s trail arc but they failed to give me results.
@Ludvig’s Melee Weapon Trail kinda worked, but it gave me weird trail renders as you can see here:
It’s definitely smoother than what I had before but you can still see the jaggedness in the trail.
So I tried Sirhaian’s suggested Better Trails, while that GREATLY improved the quality of the trail its still not as smooth as the reference:
but if this is what I have to settle for with unity being “incomplete” in a sense as @Ohadgfx mentioned then I guess I’ll take it. But part of me is dead sure that the reference gif used the built in trail renderer in unity. But I’ll have to take what I have for now.
Now another few issues I face here are:
My trail seems to tick off instead of smoothly fading away.
The trail only seems to work against one camera angle and disappears at the other angles?
@Sirhaian hopefully can help me with this? I’m using Better Trails?
Thats tails vs ribbons…Trails are typically 2d so they always bend at cam like a particle… you cant have a swoosh that is parallel to a sword edge AND bend toward cam… currently you are using a ‘ribbon’ generator without backface rendering.
Unity default trails is absolutely an insufficient tool as this post has detailed and Unity fx artists know…requiring catmul-rom procedural mesh creation to create a custom tools [tech art needs].
broot force* you can model an arc and manually animate it with a good enough* shader to ramp your color over time… but a perfect* trail-ribbon render sysyem still needs a perfect arc in the character animation to track a mounting location. SO a very fast animation can often lack enough points and require broot forcing techniques anyway.
Ah thanks for clearing the trails vs ribbons thing. Silly me for expecting that lol. I’ve seen Ohad do some work with the brute force way you mention. I guess I’ll use it as a last option if I can’t get the ticking fixed. Part of me thinks that in game when the lifetime of the trail is 0.1 seconds the ticking would barely be noticeable, specially with a material alphas on. If not I’ll probably be doing the brute force way.
Did you try reducing the “Min. Control Point Distance” and rise the “Points between Control Points”? It should make it smoother.
You’ll need a shader with vertex color on the alpha to make it fade out. Either use a texture mask to fade it out at the end, or use the color over time of the trail. Also checking the “Stretch” box to make sure the gradient spans the whole trail.
Here’s one trail I’m currently working on. The gif record isn’t that good, but oh well:
Thanks a bunch for your reply mate! Appreciate the help a lot. Your tips helped me out a bit. I tried applying some of what you mentioned to my trail. Would you say I’m on the right track and can continue refining the trail now?
(the gif makes it choppy for some reason its smoother in unity without the gif recorder)
Setup for the trail and material, just used the one that came with better trails would you suggest changing this?:
I think you should make it larger, to take a good chunk of the sword’s blade. Besides that, I think it’s a pretty good start. And it already looks okay on the gif.
Just change the texture for whatever style you’re aiming for. Then, change your gradient to have some color variations (brighter at the edge of the blade, darker at the end of the trail). And change the scale over time too. Try maybe something that grows a bit bigger at the end.
Hi man great progress! About my testing video you saw i used a mesh at first because it was the fastes way for me to block the swoosh and then i could play with a shader on it , i looked at @frontakk approach and gave it a try. Honestly it still doesn’t work the way i hoped. Im learning here that I might should go for the smooth trail as well. I got the XWeaponTrail from the asset store to learn the c# code but it was wayyyy to intense for such a small thingy i wanted.
Overall Im learning here something new and I will fix my work aswell ^^ thanks @veer for the awesome thread and @Sirhaian for putting light on this hidden possibilty in unity