# How to move an entire particle generated Starfield?

I have used a script and some tutorials on creating random particle system Starfields. It sets the particles nicely randomly in a circle. But is there a way to move the entire set of particles in the circle around without moving their x and y coordinates? Wanna simulate scrolling backgrounds. This is the code I have so far.

``````private void Create()
{
float x = Random.Range(0.0f, 50.0f);
float y = Random.Range(0.0f, 50.0f);
float z = Random.Range(0.0f, 50.0f);

points = new ParticleSystem.Particle[maxStars];

for (int i = 0; i < maxStars; i++)
{
float r = Random.Range(0.5f, 1f);
float g = Random.Range(0.5f, 1f);
float b = Random.Range(0.5f, 1f);
var circle = Random.insideUnitCircle * 90;
var newpos = new Vector3(circle.x, -5, circle.y);
points*.position = newpos;*
``````

points*.startSize = Random.Range(0.05f, 1f);*
points*.startColor = new Color(r, g, b, 1);*
}

Stars = gameObject.GetComponent();

Stars.SetParticles(points, points.Length);
}

Either use a local simulation space and rotate the transform of the game object, or look at the orbital velocity settings in the velocity over lifetime module. The first option is most efficient.

Thanks, never thought of actually moving the GameObject. Feel dumb now. This in update did it:

``````   var uselocal = Stars.main;
uselocal.simulationSpace = ParticleSystemSimulationSpace.Local;
StarfieldObj.transform.Translate(Vector3.back * Time.deltaTime * scrollspeed);
``````