Question by
lolpiggy1011 · Oct 09, 2020 at 09:31 PM ·
particlesparticle systemparticle collisionparticleeffect
Making particle effect script on collision
Hey, Im trying to get particles to show when running into the object (its a pickup item like health orbs) however the object just deletes and doesn't show the particle effect. not sure exactly why its not working so i thought i'd get some help P.S this is the script
public class ImpactEffect : MonoBehaviour
{ public ParticleSystem Impact;
private void OnCollisionEnter(Collision collision)
{
if (collision.collider.CompareTag("Player"))
{
Destroy();
}
}
public void Destroy()
{
Instantiate(Impact, transform.position, Quaternion.identity);
Destroy(gameObject);
}
}
Comment