- Home /
Flame Thrower - Particle Colliders?
Hello,
I've made a flame thrower - that right now, just throws out a particle system (fire!). Is there anyway to find out if the particles are hitting something?
I'm guessing that if I were to add some kind of collider on the particles then it would be expensive? ... Or will it?
Basically, I just want: Particles = true, if particles hits enemy, hit point - 10
Any advice? Cheers all!
Answer by Proclyon · Dec 10, 2010 at 04:57 PM
Flamethrower in title, and flame in tag. If that doesn't catch attention , well I don't see how they can care about games sorry :P.
And about that question, this should explain everything, especially the part about...
Collides with: Which Layers the particle will collide against.
Set layers using the tag manager. Don't forget to use the ~ operator on the bitmask if you want to check if you hit everything EXCEPT that layer to avoid killing yourself.
Then again......flamethrowers should be used with caution right? Why do extra work for removing a feature that could be fun, sounds like investing in a lost cause.
Hmm.... I wont lie to you. I have absolutely no idea! Let me know if you find out though :)
Answer by Justin Warner · Dec 10, 2010 at 03:35 PM
Um, what I'm doing is get the distance between the "Bullet" and the "Enemy" (Check it in the update function so that it'll check 30+ bullets/enemies a frame), and have it go with the Tag system btw, and then have it do
if distance is less than .1, destroy(gameObject), and do animation of exploding or spawn the destroying particle system...
Hope that makes sense... It might not be the best way to do it, but it works...
It sounds logical, but my flame thrower literally spits flames everywhere randomly, so it wouldn't work for me
Actually I think you can. Tagging/Layering means literally $$anonymous$$AR$$anonymous$$ING something you made as "I_A$$anonymous$$_HU$$anonymous$$AN" or something similar. Or better yet "I_A$$anonymous$$_FLA$$anonymous$$$$anonymous$$ABLE". Silly names sure, but truly impossible to misinterpret them :)
Answer by tythegeek · Nov 16, 2016 at 10:50 AM
@oliver-jones in your particle system, towards the bottom there should be a box marked collision, check it and then expand it, again towards the bottom of that menu check "send collision message", then on your enemy script add a void OnParticleCollision() and subtract the health in that void, it will be lower than ten though. As that code will run for every particle that hits the object
Your answer
Follow this Question
Related Questions
How to make OnParticleCollision affect multiple GameObject 1 Answer
Collision Enter one of the objects ? 1 Answer
Tank Missle Colide then explode and destroy 1 Answer
Collision detection for sprite 1 Answer
How does Unity detect collision? 0 Answers