Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class EnemyBehaviour : MonoBehaviour
- {
- public ParticleSystem explosionParticle;
- public void OnTriggerEnter(Collider other)
- {
- if(other.CompareTag("Ground"))
- {
- //the following allows particle effect to play after gameobject has been destroyed
- explosionParticle.transform.parent = transform.parent;
- explosionParticle.Play();
- Destroy(gameObject);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement