- Home /
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.
Answer by Kid Canuck · Apr 03, 2014 at 07:14 PM
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[i].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.
@$$anonymous$$id 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?
Right, so as I mentioned I've no program$$anonymous$$g experience... Would it be merely a question of saving this snippet as a .cs file and adding it as a ScriptComponent?
Answer by jcolombo · Apr 13, 2013 at 01:10 AM
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 $$anonymous$$esh 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?
Answer by gridside · Oct 02, 2014 at 03:03 PM
There is no solution for this in the current version (4.5) of Unity.
Answer by sterlingr · May 15, 2015 at 04:34 PM
It's been 2 years and still nothing...
I just ran into this problem.
Sigh