# How to rotate particles at a constant rate?

I’m not sure if this is a bug, but something is wonky about InitMeshRotationRate. I’m trying to get the particles to inherit the angular velocity of their parent emitter (realistic). I can get them to spawn with the instantaneous correct angular velocity (though the fact that the parameter is in terms of Euler angles is annoying and inconsistent). The problem is that the particles don’t rotate at a constant rate after they spawn.

https://zippy.gfycat.com/MenacingGrossElephantseal.gif

The same thing occurs if you use the MeshRotationRateOverLife module. My question is what’s going on? It looks like the mesh is simulating physics – but not UE’s fake rotation physics – PhysX’s actual rotation physics that uses the full inertia tensor in its equations of motion.

I’m inexperienced with Cascade, so maybe I’m doing something wrong… How can I get a mesh particle to have a constant rotation rate?

EDIT: I figured out what’s going on. It’s a bug. See posted answer.

Its really hard to tell whats up with such a small image.
it looks like very poor pivot placement, but without any proper visual information I cannot even begin to try and solve this

Sorry about that, should be better quality here GIF by turingmachine | Gfycat. Even with a poor pivot, that’s not constant angular velocity.

can you show me the shader, and the pivot point of the mesh?
If those are fine then… im confused af.

Okay I figured out what it’s doing, and it’s definitely a bug. Here is a better [[gif of the particle system][1]]. The particle system spawns a mesh and sets an initial rotation rate via the InitMeshRotationRate module. As you can see, the rotation rate is specified by a vector that represents normalized Euler angles (1 = 360 degrees). This representation is a poor choice in my opinion because it is inconsistent with the angular velocity representation in Blueprint. The vector parameter should correspond to the scaled rotation axis (length = speed). But I digress. The mesh is just a cylinder with a pivot at its base. The rotation rate vector is chosen as [0.1,0.3,0.4].

The problem with Euler angles is that you can’t simply add them together, and that is what Cascade is doing to rotate the particle. The following shows on the left the particle (yellow) and on the right a mesh (pink) rotating with the same delta rotation, but using the correct CombineRotators blueprint node. Notice how the pink mesh has a constant rotation rate as it should : [[gif of combined rotation][2]]

Now instead of using the correct CombineRotators node for the pink mesh, we simply add the rotators. We see the rotation is exactly the same as the particle. Therein lies the bug. [[gif of added rotation][3]]

Here is the blueprint tick function of the rotating pink mesh.

http://i.imgur.com/I6iBZNs.png

I figured out what it’s doing (see posted answer). It’s adding the Euler angles rather than combining them correctly. In the posted answer I switched meshes to one pivoted at the base (easier to see). The shader is just an emissive fresnel. I can’t think of any good hack to get around the bug unfortunately.

I can forward this to some ue4 dev’s.
Though, it probably ends up with either Tim, Eric, or one of the other awesome folks to say “might stay like this until niagara”

Lol, I mean, the fact that you can’t rotate particles correctly is a pretty core bug imo. And the cause of the bug has been specified so it should be easy to fix. But what do I know. But yes please forward it. I’ll have to come up with a workaround in the meantime.