- Home /
is it possible to detect the Particle Collision from another gameobject like a normal collision ?
Hi all!
I have been googling and experimenting for some hours and it looks like this is not possible, but before surrender I would like to ask the community:
I'm working in a 2D game, I just implemented some attacks with particle collision, the method " void OnParticleCollision(GameObject other)" works perfect, but the problem is that the attack detection and effects are on my enemies scripts (using the usual "void OnCollisionEnter2D(Collision2D col)"), now, I would like to keep using this method, and let every enemy be in charge of its own damage but it looks like the particles collision will only be detected by "OnParticleCollision" inside the particle script.
Is there an easy way to handle this and have some sort of OnParticleCollision detection in my enemies sprites?
Thanks in advance!
Answer by bennett_apps · Aug 15, 2018 at 03:17 AM
I literally tried that...now I tried again and worked straight away,not sure what piece I was missing the first time but thank you very much for make me go back to it again
Answer by richardkettlewell · Aug 15, 2018 at 05:33 AM
You can add OnParticleCollision to the particle system or the thing it collides with. Read the docs link posted by jessebennett, it explains it there.
Your answer
Follow this Question
Related Questions
OnParticleCollision Question (Image included) Particle Decal Hanging off Edge 1 Answer
Unity 2D Particle System's collider doesn't trigger other colliders for scripts. 0 Answers
Particles only colliding with one of the player's two colliders? 0 Answers
How to change particle colliders [2D] 0 Answers
OnCollisionExit for Particles 0 Answers