Hello,
i’m new on unity and I’m trying to make particles flow from one object to another like “energy”, is there a way to do that without script? or an algorithm?
Thanks in advance
Hello,
i’m new on unity and I’m trying to make particles flow from one object to another like “energy”, is there a way to do that without script? or an algorithm?
Thanks in advance
anyone? ![]()
Looktutorials on youtube ![]()
I saw many tutorials but i can’t find a way to create particles in one point (vector3) and they die on a end point (vector3).
Something like this: http://vimeo.com/15037736
but the path is just a straight line linking the point A to point B
Thanks.
BurgZergArcade on youtube
Thanks for the replies!
i saw this videos on youtube but i not found what i wanted
I created this script to make the particles flow between the points like i need:
void LateUpdate() {
int length = particleSystem.GetParticles(particles);
int i = 0;
transform.LookAt(target);
while (i < length) {
//Target is a Transform object
Vector3 direction = target.position - particles[i].position;
direction.Normalize();
float variableSpeed = (particleSystem.startSpeed / (particles[i].lifetime + 0.1f)) + particles[i].startLifetime;
particles[i].position += direction * variableSpeed * Time.deltaTime;
if(Vector3.Distance(target.position, particles[i].position) < 1.0f) {
particles[i].lifetime = -0.1f; //Kill the particle
}
i++;
}
particleSystem.SetParticles(particles, length);
}
Another option is to add a plane where you want the particles to stop. Then enable collision on your particle system and drag the plane into the planes list. Finally set the lifetime loss high enough so it ends the particle life at that point. Or you could set the min/max kill speed.
When your effect happens you can move the plane to the point you want your particles to end. Make sure the particles have a enough life time and/or speed to make it to your end point.
For future visitors, I eventually found a very good free unity asset which does this. It’s part of a repo with several other great tools. It supports multiple points, and smoothing of the path. GitHub - BLINDED-AM-ME/UnityAssets