How do I change the axis of rotation on a mesh particle in Unity 4.1?

I recently upgraded from 3.5 to 4.1. I had a long mesh particle rotating around the Z-Axis in 3.1. When I upgraded to 4.1 it changed to rotate around the Y-Axis. How do I change this? I’m using the Rotation over Lifetime to rotate.

4 Answers

4

I think it can be done in code. There’s an undocumented property on a ParticleSystem.Particle called axisOfRotation, which you can set. You’d have to do it per-particle however, so somethign like this:

ParticleSystem.Particle[] myArray = new ParticleSystem.Particle[256];
int count = MyParticleSystem.GetParticles(myArray);

for(int i = 0;i < count;i++)
{
    myArray*.axisOfRotation = Vector3.Forward;*

}
I hope this helps, I found this post searching for a solution to my own problem (setting particle rotation on more than 1 axis) and thought I’d share what I have so far in case it was helpful.

@Kid Canuck, is that JS or C# code? I have no idea about coding whatsoever as you might imagine. Has anyone successfully managed to get correct mesh particle facing using a script component?

This is one of the highest viewed questions… I am new to Unity and only have used version 4.1. Correct me if I’m wrong, but the earlier versions looked like they had editable values for all three axises in the “Rotation over Lifetime”. I would love to know the answer as well.

We are on 4.2 now and there is still no answer for this? It does seem very wonky that there is no option to to change the axis at which you want to rotate a Mesh particle. The only options available are the angle at which you'd like to rotate it over time and the speed at which it moves.

Just hit this little problem now.. no axis for rotation?

There is no solution for this in the current version (4.5) of Unity.

It’s been 2 years and still nothing…

I just ran into this problem.

Sigh