Animated mesh + particles workflow in Unity

Hi everyone,

I’d like to pick your brains regarding animated mesh workflow in Unity when used in conjunction with particle systems for VFX.

It is my understanding that a rig and animator component are involved but what about when it comes to actually working on the effect? Is there a way to preview particles and a mesh animation all at once or is the only way to go into Play mode to have the animation play out?

Reason I ask is because AFAIK there’s not an easy way of previewing animated meshes together with particles all part of the same system. I also think some basic scripting is also necessary to set up the animated mesh triggering, right? To be able to loop it again and again.

I know it’s a bit of a strange question, I was just wondering if anyone knows of a straightforward way.

I know your issue, I suggest you try out using the Timeline tool for preview purposes. In the Timeline, make a Particle track and an Animator track then hook up your stuff there.

Ah yes, I’d forgotten I tried Timeline a while back, it’s very finicky but that’s probably just because it takes some getting used to.

Is the resulting package for gameplay essentially a Prefab containing particles on one hand and then an animated mesh with an AutoPlay on it, basically?

Timeline is very easy to use! it’s not at all finicky in my opinion.
Your final VFX prefab should not contain any Timeline stuff, you only use that in your scene to preview particles together with an animation component
And yes, you can have both particles and animators in your final prefab without any problems. Usually I put the animator on the root (but don’t animate any root channels) because it’s easier to find there

How do you mean about not animating root channels?

Another question that comes to mind is, I’m sure that often certain material parameters for the animated (or not) meshes need to be animated as well, such as transparency or color changes and that sort of thing. While these parameter changes are easy to do within a particle system, how about for meshes that fall outside of a PS? Is it a matter of animating the parameters by hand in an animation clip that syncs up to the mesh animation?

Are you looking for info on approaches for animating a mesh appearance outside of a particle system?

So in a particle system what is being changed is vertex data which the shader uses for various animation purposes. When wanting to do an animation on a mesh outside of a particle system there are a couple potential methods. You can edit the vertex data of the mesh via code (just like how particle system does: vertex color, uvs, etc) or you can modify material parameters. When you modify the material parameters with an Animation Clip, Unity constructs a Material Property Block for you to handle changing the various material parameters.

When thinking about trying to sync up these animations, I am not sure if there is any built in good way to sync that info without getting into some code. If you did use Timeline to animate your materials then you could copy curves and color gradients for animation from the particle system to the tracks to make sure they have the same timing. But using the Animation window to create the mesh animation I am unaware of any builtin way to sync and copy the animation settings. You could however do that portion with code if you wanted to sync them.

How do you mean about not animating root channels?

Do not animate any transforms on the GameObject where the animator component is attached to, better to make a child GameObject to animate in my opinion!

Another question that comes to mind is, I’m sure that often certain material parameters for the animated (or not) meshes need to be animated as well, such as transparency or color changes and that sort of thing. While these parameter changes are easy to do within a particle system, how about for meshes that fall outside of a PS? Is it a matter of animating the parameters by hand in an animation clip that syncs up to the mesh animation?

yes. Exactly like that.