UE4 - Weapon slash: Meshes vs AnimTrail Data

unreal

#1

Hi!

I’m new to vfx and I’m trying to learn how to do trails (sword, shield, etc). I’ve seen people do it with meshes (with a texture and some rotation and scale). Others do it with the AnimTrail Data, in unreal, or line renderer in Unity. Could someone tell me which is the difference? Which is better? Maybe it depends on the situation?

Examples:

In my case I have a 3 combo attack, where the weapon is a shield. The movement is not “horizontal” or “vertical” so I choosed AnimTrailData. This is what I have achieved.

ShieldSlash
Does someone knows why it appears “cut”, like it’s missing more segments. Also the movement is not round, its not an arc, and maybe it will look better with a mesh.

Thanks!


#2

Something to keep in mind with UE4 Anim trails, is they will only make sections per frame of animation that you import.

Ex: if you have a character in Max or Maya, and he swings his sword 180 degrees over 4 frames, Unreal will blend and interpolate the sword moving in that arc, but you will see 4 distinct edges on you trail arc, no matter how much tessellation you give it.


#3

Heya, welcome, I’m sure you’ll enjoy your stay here :smiley:

For me the differences come down to control and usability. Heres a few things to keep in mind

  1. Almost every game engine out there alows you to spawn meshes and add a texture to it. Not every engine can create inticate trail renderers.

  2. Creating complex meshes is often time consuming, but it gives you full controll over what your effect looks like at any point.

  3. Trail render solutions often come with options to create camera facing effects, meshes will not. Depending on the game this might or might not be a problem.

  4. Meshes are not a flexible solution, if the animation changes, your mesh will have to be remade or adjusted accordingly.

  5. Trail renderers are often framerate dependend, they might create weird trails if your animation is too fast or your framerate is to low.

As usual, it mostly comes down to picking the right solution for the right problem. If you need something quick and dirty, a trail renderer will do the trick just fine, if you need perfect control over the slash, then a mesh is often a better solution. If your trail needs to face the camera to work, then a trail renderer might be a better solution again.

Also worth noting is that external tools (I believe @Partikel made something like that at some point) to create these meshes slightly omit the flexibility problem and allow you to author them much quicker then having to make them in max for example.

Hope that helps,

Good luck


#4

Thank you both for the explanations, really helpful.

I didn’t know that they use frame of the animation, and it’s really important to know. I’ll try meshes in this case because I need a more clean effect.


#5

Here’s the one @Wyvery mentioned I made.
https://www.sidefx.com/tutorials/curvesweeper-intro-to-houdini-engine-houdini-for-games/


#6

Glad we could help! Another issue you can run in to with with ribbons and trails is the speed of whatever they are connected to. You shouldn’t run into this issue with sword swipes and such, but if you try to use them on things like a really fast moving projectile, they hit a threshold where they can’t keep up with their attach point.

A while ago someone was making a top down star ship shooter, and his player ship was moving too fast that even offsetting the trails up to the nose of the ship didn’t help.


#7

As others have mentioned there are a few things to take note of when you’re deciding to make a trail:

  • Frame rate, If the frame rate isn’t consistent ribbons break.

  • Speed, Sometimes the Ribbon leaves a space between your object and the actual trail need to compensate for that.

  • Meshes offer more control especially for motion and shader work.

  • Ribbons are easier / faster to setup and most of the time will do the work especially if it’s a simple motion. I’ve used ribbons for some complicated motion too but rarely.

  • Ribbons need their texture UV set properly on your material, If i remember correctly you need to set a Texture coord UV for either your mask or the panning texture (if any) to 1 so it will stretch properly across the ribbon path instead of traveling with and panning with it. (Someone correct me i can’t remember off the top of my head).

  • Meshes can be less accurate but if the swing is fast or complicated (controlled chaos) saves the look and nobody sees a little misalignment or distance.