Moving particle system via script causes choppy movement in build but works fine in pay mode

Hello, I’m drawing a bunch of particles on the screen with a small for loop like so:

			for( int i=0; i<MaxStars; i++ )
			{
				float randSize = Random.Range( StarSizeRange, StarSizeRange + 1f );						
				Stars*.position = GetRandomInRectangle( FieldWidth, FieldHeight ) + transform.position;*

Stars_.startSize = StarSize * randSize;
Stars*.startColor = color;
}
Particles.SetParticles( Stars, Stars.Length );
Then on the update method I’m trying to move it according to the camera, this works perfectly in play mode, but when I build it and run it the particles movement is very choppy but the rest of the game (character, npcs, monsters) moves fine.
private void Update()
{
Vector2 velocity = camera.velocity * -1 * parallexModifier * Time.deltaTime;
var pos = Particles.transform.position;*_

* Particles.transform.position = new Vector2(pos.x + velocity.x, pos.y + velocity.y);*
* }*

Where do you do the drawing? What does the full code look like?