- Home /
A particle's velocity to an arch
I have created a ParticleSystem that spawns one particle every second, and that particle has a sub emission of another particle system, witch create a sort of a trail. My problem is how can I change the velocity of the main particle so that it goes in the direction that originally comes from, in a circle. Here is a picture of what I want to do:
The green line shows how i want the particle to travel, like a Sun eruption.
I maneged to find how to edit the particles but how can I make a path like that?
function LateUpdate(){
particlesCount = ParticleObject.GetParticles(Particles);
var i:int = 0;
while(i <particlesCount){
Particles[i].velocity =;
i++;
}
ParticleObject.SetParticles(Particles,particlesCount);
}
Answer by Owen-Reynolds · May 23, 2012 at 01:34 PM
To have it get "pulled" back into the sun, compute the direction to the sun, and give a little push that way:
Vector3 sundir = (sun.position - P[i].position).normalized;
P[i].velocity += sundir*Time.deltaTime*10; // 10 is the "pull" of the sun
This same code works for homing missiles.
Your answer
Follow this Question
Related Questions
expanding ring velocity (ellipsoid particle emitter) 1 Answer
How do I accelerate particles in Shuriken? 1 Answer
iTween even velocity 9 Answers
Make object stay inside circle 1 Answer