How do I set the position of a newly emitted particle in a local enabled particleSystem?

Any help would be Greatly appreciated; I have been having this problem for over a week.

here is my current code attempt, made from what I could find in other unity answers and forums, problem is all of the particles apear at the same position, even when the position smoothly changes, all of the particles move as if attached to the hit point instead of leaving a trail behind.

function EmitAtPos(position: Vector3, amount: int){
particleSystem.Emit(amount);

var particles: ParticleSystem.Particle[] = new 
ParticleSystem.Particle[amount];

if (particleSystem.GetParticles(particles) < amount) {
	Debug.Log("Hey!");
        return;
}

for (var i: int  = 0; i < amount; i++) {
        particles*.position = position;*

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

  • Debug.Log(position);*
    }

You need to call the ParticleSystem.SetParticles-function as well, otherwise the changes will not be stored. Like so (in C# though, but the technique is the same):

ParticleSystem m_currentParticleEffect = (ParticleSystem)GetComponent("ParticleSystem");
ParticleSystem.Particle []ParticleList = new    ParticleSystem.Particle[m_currentParticleEffect.particleCount];
               m_currentParticleEffect.GetParticles(ParticleList);

               for(int i = 0; i < ParticleList.Length; ++i)
               {
                 ParticleList*.position = newPosition;*

}

m_currentParticleEffect.SetParticles(ParticleList, m_currentParticleEffect.particleCount);
[Link to SetParticles documentation.][1]
Good luck!
[1]: Unity - Scripting API: ParticleSystem.SetParticles