Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by Sir_Realism · Dec 11, 2018 at 02:57 AM · particle systemparticle collision

How to specify particle collision detection

I am using multiple particle systems in my game, and I would like to create a different trigger for each.

However, it seems I can't do this without having one type of particle (for example: a flamethrower) trigger the same reaction as a different particle system (a fire hose) despite my efforts to differentiate the two.

My guess is that since both particle systems are set to "Send Collision Message" when colliding with something, that the game does not know how to differentiate the two, and as of now both my flamethrower and my fire hose set things on fire (They both send the same collision message).

I have been using the function OnParticleCollision(), is there any way to specify which particle system activates my script if they are both sending the same collision message? Is there a way to differentiate the collision messages being sent?

I have searched for answers to this problem and have not found anything, but I can't imagine I am the first to run into this issue. All help is appreciated, I am stumped. Thanks in advance!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by ifurkend · Dec 11, 2018 at 04:01 AM

The code example in OnParticleCollision() script manual already states that you can use GetCollisionEvents to specify collision events from one specific Particle System. Recently I have written an Audio Playing script on Particle Collision, here is the excerpt of my code:

     void OnParticleCollision (GameObject other) {
         if (_collision == true) {
             int numCollisionEvents = _particleSystem.GetCollisionEvents(other, collisionEvents);
             for (int i = 0; i < numCollisionEvents; i++) {
                 PlaySound(collisionEvents[i].intersection);
             }
         }
     }

The Particle System component with Collision module enabled for sending collision messages is assigned to the _particleSystem variable of the script.

Comment
Add comment · Show 3 · 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 Sir_Realism · Dec 11, 2018 at 05:20 AM 0
Share

Ah, I figured I must have missed something, I will give this a try and report back! Thank you for your response!

avatar image Sir_Realism · Dec 11, 2018 at 06:56 AM 0
Share

Well, I gave it an honest try, but after more confusion I have thrown in the towel for the night. Thank you for pointing me in the right direction, however I feel my understanding of coding is too rudimentary to solve this issue now (this is my first Unity project and I have zero prior experience with coding).

I'll fiddle around with GetCollisionEvents more, but for now I've got to take the L and call it quits. Thank you for the help, sorry I wasn't able to get back to you with a better conclusion!

avatar image denholmspurr Sir_Realism · Apr 24, 2020 at 06:53 PM 0
Share

Did you ever solve this? I've spent 2 days trying to work this out and I'm totally stumped.

The collision is recognised but the game object is not.

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

103 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to Make Particle Effects Function as a Trigger That Deals Damage 1 Answer

How to keep particles moving past an obstacle after they have collided with it? 3 Answers

how to give particle bursts their own colliders 0 Answers

Particle effects won't collide/play properly 0 Answers

How to detect which exact particle element from a particle system hit a collider? 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