- Home /
How to detect a collider in a particle?
Hello community.
I need to know how I can collide a particle with a GameObject with some detection collider added on it.
Example:
I've an enemy who's shoot is a constant particle. And I need to collide it on my player.
I'm completely lost, what method can I use?
Thanks in advance.
Regards.
I think you can set the simulation space option to world space not local space, then it will work, also enable collision and set the parameters there, all of these things I refer to are for the particle system. Hope that helps
I made a quick video for you, see youtube link:https://www.youtube.com/watch?v=oZ5rAo$$anonymous$$j7cA&feature=youtu.be
Answer by cdrandin · Jan 22, 2015 at 11:18 PM
How complex is the particle? Can it be characterized as a ray? Don't try to do collision per particle that is being emitted. That is completely overkill!
Rather incase your particle in some basic primitive collider. If you only care about direction collision use a Ray, if you care about linear spatial collision use a capsule. Just play with which geometry suits your needs.
Answer by DanSuperGP · Jan 22, 2015 at 11:19 PM
Assuming you're using a Shuriken Particle System, you would use OnParticleCollision.
http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnParticleCollision.html
Answer by Ryujose · Jan 24, 2015 at 03:46 AM
I've done some checks with documentation and it doesn't Works.
The thing I'm trying to do is:
I've a group of particles in one particle system. Those particle systems are shooted by an enemy.
And I want it to those particles have effect on my player like a collision with some detection but it doesn't Works.
I've configured the "void OnParticleCollision(GameObject other)" by tag, but in practice it doesn't collide with player.
I've set the colision on true, on inspector. And it do nothing at all.
I've tried to add a box collider or something else but it says is to small to detect it.
I'm using 2D settings for colliders.
Any tips? Thanks for the help.