Niagara: how to keep a ribbon facing a direction in local space without loosing the trail?

Hi everyone! I hope someone can help me.

So, basically, I have a character swinging a spear and I want to emit a beam-like ribbon that leaves a trail behind. The problem is that I do not want it facing the camera as it would be apparent that it is not oriented like the spear blade, but if I set it to face a direction it does so in world space, making it even worse and having the ribbon always face an axis. The thing works if I put the emitter in local space, but then of course the trail no longer works as the system does not see the spear movement. In this case the particle effect is attached to a Socket in a Skeletal mesh inside a blueprint.

So how can I keep the orientation of my Ribbon renderer fixed to a local axis (say {0, 1, 0}) without having to set the whole emitter to local space (and so loosing the trail)?

Here’s my problem exemplified: as you can see the ribbon doesn’t follow the blade inclination and it’s quite noticeable. You can download an example project to try here.

Thanks in advance!

I believe in a modules you could find the worldspace transform of the system and save it to a variable. Then on the ribbon emitter, you can feed in that orientation.

Please let me know if this works or not, I haven’t had the change to test anything like this out just yet.

uhmmm I pretty much tried everything. What you say makes sense, I just can’t make it work. Maybe I use the wrong variables or the wrong nodes, i don’t know, there’s not enough documentation for me to know, but the result is always strange, and the ribbon emitter is rotating strangely. I tried to use this too but at no avail (but again, I don’t know how to use matrices and neither if those variables are passing the right infos)

I even tried to guide the orientation through blueprint by passing the parent transform but nothing

Yeah, documentation is still a bit lacking right now, I believe in the future we might get interfaces to build trails between bones as we did in cascade.

I’ll have a look at this if I find a bit of time, I’ll let you know if I get any further.

Thanks man! I’ve uploaded a small project in the main post already setted up to try out. The animation I’m working on is much more complex than that and the weapon is not a separate skeletal mesh, but the principle is the same

I had a little bit of time to look into this, here is my result

I’ll walk you quickly through it:

First off, I made the module spawn only and set the output map to feed into ribbon facing (We don’t really need this code for anything else, so there is no point in generalising)

I called the module Initialise Sworld Trail, exposed it to the library and then added it in the emitter on Particle spawn after the ribbon initialisation module.

I set the facing vector to (0,0,1) in case for the custom side vector mode of ribbon facing
image

I attached the ribbon as a timed niagara effect in the animation and attached it to a socked in the middle of the sword.

Hopefully that works for you.

10 Likes

Thank you, I’m very grateful for the time you dedicated to it! I saw you reply just now, but I solved it an hour ago thanks to Gleurk on the discord server. Your result looks great as well, and I’ll definitely give it a try tomorrow! Anyway, I’m sure this will be useful for anyone trying to get that effect in the future. It is not hard to get after all, but with such scarce documentation it’s really great to have more experienced users like you helping out, because it proved to be more abstruse than I thought.
Thanks again!

1 Like

So, for anyone wandering what the other method is, under the ribbon renderer module set the facing mode to custom, and on particle spawn set the variable Particles.RibbonFacing with a transform vector dynamic input, where you’ll put your orientation vector on Local for source space and on World for destination space.

2 Likes

Hi @Wyvery , can you post your setting to achieve that sword trail effects? I have find any tutorial for this but couldn’t find for niagara :confused:

1 Like

Things have changed a bit since then, so Im gonna have to look at this again

The same thing I showed in the post still work.

Just make sure you spawn particles in such a way that you can use the tesselation to smooth things out propperly

1 Like

Ahh finally I made it work, you forgot to mention that Facing mode need to be set to Custom side vector :smiley:
Thanks for your information

Ah, good point! I did forget to say that.

If I find some time tomorrow I might lineout the findings in this thread into a slightly more condensed and easier to follow tutorial. That way hopefully it will be easier to for people to find.

1 Like

Hi, I have found another issue, have been playing setting for the ribbon tilling but I can’t figure it out why it is still not smooth :frowning:

I^m not sure what I’m looking at here,is the trail overlapping with itself?

Try lowing(yup, lower) spawn count, you don’t want too may particles too close to eachother, because then the tesselation doesn’t work properly.
Essentially you want particles to ouline about the same distance away as the width of the trail, any closer it the trail might break.

Talking about tesselation, that’s your main way of getting the trail to be smooth.
Here are the settings that worked in my case, but that doesn’t mean it will work in your case.
image

You’re right, I just find out that is the tessellation problem. With your setting, the ribbon is getting smoother now, still not as smooth as cascade trail if I compare them, but in my case this is acceptable already. Thank you again :smiley:

1 Like