so im trying to delete instatiated particle effects. but for some reason, what i have tried is not working at all.
i can delete my player fine and dandy, which is done after the sound has played. but the particle effect is something that has been unable to delete
here is a snippet of my code which includes what is being deleted. but im justh a bit stumped that these are not working. im gathering because its in the enemy, but still cant get it to work
i have looked all over and what i have found has led me to what i have now, but still it does not delete. found some stuff on the unity answers, but thats the exact same.
Download the free particle stuff off asset store and then look at the script for the GUI for when you click and it changes the animation, look at how they destroy the particle prefab this is what I done last night and learnt how to make effects for when my player attacks my enemy using parts of the script from the GUI.
@Josenifftodd
ill have a look, though i try to steer clear of the asset store just because i dont want to resort too it for game dev. i like to try and figure things out and build from scratch thats the OCD in me
ill have a look though, see what i can find
Ahh true man well if you don’t want to check them out I’ve attached the scripted I used to make it so when my player attacks the particle comes up and then goes not sure if its what your looking for but might work It’s in JS though.
public var attackEffects : GameObject;
public var effectObj : GameObject[];
function effectOn(){
if(attackEffects != null)Destroy( attackEffects );
attackEffects = Instantiate(effectObj[ arrayNo ] );
}
did find a unity team particle system. nice to see what the particles system can do really. did find some code that could come in handy but will look in other avenues that would be less code.
may go to it, but good to look at and learn
AND, wouldnt scripting the particle work? i did try one way and it didnt but that was with using a timed countdown then destroy. but would feel that would work also.