# axisOfRotation

> Mesh particles rotate around this axis.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.ParticleSystemModule

```csharp
public Vector3 axisOfRotation { get; set; }
```

### Remarks

Mesh particles travel around an axis set up for each particle.

### Examples

```csharp
using UnityEngine;

[RequireComponent(typeof(ParticleSystem))]
public class ExampleClass : MonoBehaviour
{
    public bool overrideAxisOfRotation;
    private ParticleSystem ps;

    void Start()
    {
        ps = GetComponent<ParticleSystem>();
    }

    void Update()
    {
        if (overrideAxisOfRotation)
        {
            ParticleSystem.Particle[] particles = new ParticleSystem.Particle[ps.particleCount];
            ps.GetParticles(particles);

            for (int i = 0; i < particles.Length; i++)
                particles[i].axisOfRotation = Vector3.up;

            ps.SetParticles(particles, ps.particleCount);
        }
    }

    private void OnGUI()
    {
        bool newValue = GUI.Toggle(new Rect(10, 10, 200, 30), overrideAxisOfRotation, new GUIContent("Override Axis of Rotation"));
        if (newValue != overrideAxisOfRotation)
        {
            ps.Clear();
            overrideAxisOfRotation = newValue;
        }
    }
}
```
