I’m a new with Unity and I’m trying to make smooth trail, but get fail
I set Minimum vertex Distance to 0.01 and lower, but trail still chopp. I saw this script https://assetstore.unity.com/packages/tools/particles-effects/ara-trails-102638?aid=1011l34eQ&utm_source=aff
But I’d like know, can I get similar effect without script?
Thank you in advance!
Hi there @Jeglova.
I had the same problem as you can see here.
Ara Trails and Better Trails are two of the most used trail assets in Unity, but they are still not perfect.
The animation is so fast that the trail tries to follow the sword frame by frame, but it can’t keep up to speed. To see this in action, reduce the Time.timeScale to 0.1f for example.
You could try to calculate the animation substeps and interpolate the trail with that data, but it may not be the best workaround.
It would be better to create a custom trail mesh for each animation. It is much cheaper in terms of performance, and gives you more control overall.
Hope I shed some light into the problem!
I haven’t used Unity in a while, but this looks like the same problem Unreal Anim Trails have. In UE4, the engine will interpolate the inbetween frames, but the trails will only use data from the imported animation to calculate the trail’s points. I’m 90% positive if you took that same animation and made that swipe over 20 frames instead of the 4 or 5 it looks like it’s using, and re-import it, your trail will be way smoother without adjusting any of its settings.
As mentioned above by @Lush, Unity’s built in Trail Renderer only adds a new segment on each update. If you have a sword slash animation that moves a considerable distance in one frame, Unity’s trail only adds a single segment for that entire frame, making the trail look like it does in your example.
Ara Trails (and the now dead Better Trails) works around this problem by generating bezier splines from the positions and fitting a trail mesh to the resulting curve. This means even if the framerate is low or the animation is especially fast, the trail will still be smooth … but it also may not actually match the shape of the swing! Note, Ara does not use Unity Trails at all, but rather is a completely custom system that generates custom meshes at runtime.
For custom engines and Unreal games I’ve worked on in the past, the trails for sword slashes were done by baking out the points by stepping through the animation as if it was being played at 300 fps, still using a min dist check so that it didn’t create a billion points when the sword wasn’t moving, then feeding those points back into the trail system. Unity’s trails unfortunately do not offer enough control for that to be viable as you can only add points, but not easily control the orientation from script. I’ve written my own trail systems previously, but now use Ara instead (with some modifications).
Baking the slash trails into meshes inside or outside of Unity is another good option. As @Lush noted, this is way cheaper and doesn’t require any custom trail systems though does require some shader know-how.
Thank you so much!
Now it is clear. Apparently I will use mesh…
Thank you, Dear!
It is perfectly clear now.