How do I mimic a one shot effect from the old Particle emitter in the new Shuriken Particle System?
Trying to convert a particle effect to the new system.
You should check the Emission pane in the Inspector. There you will see Bursts, which can be used to achieve what you want. There’s no autodestruct available anymore, so you need to destroy the particle through code. There’s a value IsAlive in ParticleSystem that can be used to check if you can destroy the particle.
Greets
Hi,
Im new to unity and im trying to create a pong game where the ball will create sparks when it hits a wall. I’ve developed it so this happens but im not sure how to remove the particles through code. Would you be able to give me an example?
You can attach this to the particle prefab you instatiate. var timer : float; function Start() { AutoDestruct(); } function AutoDestruct() { yield WaitForSeconds(timer); Destroy(gameObject); }
– ShofarYou can attach this to the particle prefab you instatiate.
var timer : float;
function Start()
{
AutoDestruct();
}
function AutoDestruct()
{
yield WaitForSeconds(timer);
Destroy(gameObject);
}
If you uncheck looping, then it will make the particle system run its duration and then stop. Then all you have to do is Destroy the gameobject (as said above after the duration is done. The WaitforSeconds would be the duration!
Well I’m sure that creating a temporary emitter that destroys itself after a time is possible and works, it sounds very very much inefficient to do for every single source of sparks when all you wanted was to emit an instantaneous number of sparks that will die out naturally due to the particle system settings. I am willing to bet you can just add particles directly to a system but I’ll have to look into it actually myself.
© 2022 - 2024 — McMap. All rights reserved.
For those who are using it, check the "Rate" field, set it to 0 if you don't want any particle flying around between the 'explosions'.
– Gravimetric