Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by oliver-jones · Dec 10, 2010 at 03:32 PM · collisionparticlescollisiondetectionflame

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!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

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.

Here's the link for layermasks, there's plenty of samples in the script reference page aswell that helped me out a lot.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image oliver-jones · Dec 10, 2010 at 05:36 PM 0
Share

Haha, and this is not expensive?

avatar image Proclyon · Dec 10, 2010 at 05:48 PM 0
Share

Hmm.... I wont lie to you. I have absolutely no idea! Let me know if you find out though :)

avatar image
0

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...

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image oliver-jones · Dec 10, 2010 at 03:48 PM 0
Share

It sounds logical, but my flame thrower literally spits flames everywhere randomly, so it wouldn't work for me

avatar image Proclyon · Dec 10, 2010 at 05:00 PM 1
Share

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 :)

avatar image
0

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges