Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //call function where thing is destroyed
- [SerializeField] ParticleSystem destructionEffect;
- private void DestroyWithEffect() {
- if (destructionEffect != null)
- {
- ParticleSystem effect = Instantiate(destructionEffect, transform.position, Quaternion.identity);
- effect.Play();
- Destroy(effect.gameObject, effect.main.duration);
- }
- gameObject.SetActive(false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement