Niagara, sample mesh, audio spectrum: IMPORTANT BUG

Hi there, I’m going to report this as a bug but would appreciate any advice regarding this.

When I create a niagara system with simple effects like the vortex and then make this sample a mesh so the particles/ mesh particles take the overall form of the mesh I sample (like a sofa or a tree) it works fine. But the moment I feed it a script so the velocity of the vortex is driven by an audio spectrum the whole engine crashes and closes down.

I have repeated this process on all version of UE5 onwards and the crash still happens but a bit differently. In UE5.03 it will immediately crash and close. In UE5.1 it will take the form in the preview window and then crash and close.

I don’t know why this is happening, it’s a very straight forward setup.

Do you know of any alternative methods? This problem is causing a whole project to come to a halt so any advice would be amazing and greatly appreciated :slight_smile:

As you can see the system is very straight forward and imo should just work

And as you can see this is the error I’m getting

Hey there @Anthony_Attwood! It looks like the data submix it’s looking for is failing a cast, this usually occurs when there’s an issue with the Audio Mixer plugin. There’s multiple ways to possibly fix it including disabling and reenabling the Audio Mixer plugin and deleting the defaultengine.ini and regenerating it. Is your audio submix loaded when this Niagara system fires?

Hi there @SupportiveEntity

Well the thing is I can’t even feed the niagara system a submix before it crashes. I very almost got to select the submix once but then it just crashed. I don’t know why it’s saying it failed to cast when I haven’t even given it anything to ‘listen’ to yet.

I deleted and regenerated the defaultengine.ini as you suggested but nothing changed. I can’t find the audio mixer plugin, unless you meant the audio synesthesia plugin?

update1:

I tried creating the scratchpad within the niagara system this time rather than in the content browser and ‘importing’ it through the niagara library.

It lets me build the whole audio spectrum system but the moment I click ‘apply’ to be able to then add the audio submix, the engine crashes and gives me the same error as before.

update2:

attempting to force it with blueprint, I have to set up a static mesh data interface user parameter in my niagara system and it crashes with this error:

Update3:

Combining the sampling of a static mesh in the same scratchpad module doesn’t work either. If I set up the scratchpad to sample a static mesh, and then on the same ‘map get’ node I ask for an audio spectrum. All I have to do here is hit Apply and UE will crash again the same as before, complaining that it cannot cast to the submix.

I was just informed that attaching a log may help so here’s two:

MusicParticle.log (220.5 KB)

This one is from a fresh project in the ‘saved/logs’ folder

MusicParticle.log (215.8 KB)

This one if from the ‘saved/crashes/…’ folder

here’s a link to the project, I’ll try to keep it available. Just copy this setup in a fresh scratchpad and hit apply to repeat the results.

UPDATE:

Possible workarounds but this is certainly a bug as reported by ‘Deathrey’ on the UnrealSlackers discord server:

“There is a bug with static mesh data interface and audio spectrum data interface, making former think that it is not what it is, causing a bit of incompatibility. Suggest you fill out bug report form with the repro project attached. From workarounds this far, you should be able to 1) Use skeletal mesh instead 2)Have two emitters, one, that has particle positions derived from static mesh, and the other one, which would spawn using positions of 1st emitter using attribute reader and will do movement logic according to audio spectrum. 3) Bake audio spectrum every frame to either particles/grid 2d/array data interface or even a standalone render target. Then sample baked spectrum for this frame instead of using audio data interface in emitter or system, where you need static mesh data interface. My choice would be the latter.”

Awesome digging! I went ahead and could reproduce this issue on my side, so this might be an issue with the interface itself directly in UE5, so I second their idea with the bug report! Sounds like a possible workaround. If you give it a shot, let me know!

@SupportiveEntity

Hi there, I used one of the workarounds. If I give a mesh a bone and use skeletal mesh location instead and use import that mesh as a skeletal mesh, and tell the particles to use triangles as their sticking points it works just fine. No issues at all and I have the advantage of animating the mesh if I give it a full skeleton.

So this as a workaround is fine, I will just have to give all my static meshes a bone socket or something.

The other workaround using two emitters doesn’t work and I don’t know if the 3rd workaround would work for me since I need this to be a live feed/ reaction rather than prebaked animations.

Thank you and I hope we can solve the mesh data interface situation :slight_smile:

Quick update:

I submitted the bug report with as much info and source files as possible:

“Case # 00520087: In niagara, using the static mesh location/ sample in conjunction with an audio spectrum module causes immediate crash. UE5.03 - UE5.1 has been received”

Not sure how to follow the progress on this since typing any of the info given in the email doesn’t turn up the bug report I made. It should be fine though they definitely go it

Great! I’m glad that workaround worked out, after submitting the report you’re all good to just let it ride, the team may reach out to you if more information is needed and you may have a key piece, otherwise it will likely get an issues ticket soon. Thanks for helping improve the engine!

Hi there, do you know if there been any update on this by any chance?

Hey there @Anthony_Attwood! I couldn’t find any tickets on the issues board myself. I see there was an audio spectrum fix planned for 5.1 but none referencing this specifically. It may not have an issues listing yet even with the reports in.

Understandable. I was thinking of comparing the code revolving around the audio data interface in 4.26 and 5.1 and seeing if there’s an issue somewhere but maybe it’s just going to be very difficult to figure out. I’m not sure but I’ll stay optimistic :slight_smile:

Working directly on the source is always an option! Depending on the portion however, sometimes there’s far more dependencies than is feasible to go through for someone new to the system. If you identify a fix that keeps updated functionality, feel free to submit a pull request! I’m sure there’s other users going through the same bug you are.

1 Like