Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by Utoxin · Apr 08, 2015 at 09:37 AM · shurikenonparticlecollision

Particle Collisions not triggering OnParticleCollision

I'm trying to create a particle system that will collide with other objects, and having no luck at all. I have defined a particle system, and set it to use the world collider, to collide with all objects, and to send collision messages. But it never triggers any messages when very clearly passing through another collider.

The other object has a Capsule Collider, set up as a trigger collider, and is working properly with other game object collisions. I have this method on the script the other object is running:

 void OnParticleCollision(GameObject other) {
     Debug.Log ("Particle Collision!");
 }

But I never get a debug log entry.

I've read the documentation for this already, and tried several variations of options and configuration, but nothing seems to cause the particles to collide.

If you need other information, or have any questions let me know. I'm getting Unity set up on a computer at work so I should be able to provide screenshots of my object setup soon.

The object for the spaceship, which contains the particle emitter: alt text

The object for the asteroids (Objects that particles are failing to collide with) alt text

The particle emitter itself: https://www.dropbox.com/s/dgmge7xn2yk6noq/ship-shields.png?dl=0 (Can't attach 3rd image)

I have attempted changing the collider to not be a trigger, I've charged the particles from local to global simulation space, I've tried putting the particle system on the parent ship object instead of on a child, I've fiddled with all of the collision detection settings on both the asteroids and the particle system. Nothing seems to change the collision behavior of the particles at all.

ship-parent.png (127.6 kB)
asteroid.png (120.0 kB)
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

4 Replies

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

Answer by Utoxin · Apr 09, 2015 at 04:28 AM

Well, while waiting for this to be approved by the mods yesterday I ended up solving it, although it took a while.

There were two main issues.

  1. The particles needed to be meshes, not billboards. I settled on using Quad meshes for them, since I just need effectively 2D sprites.

  2. The asteroid collider needed to NOT be a trigger collider. I was worried this would break other stuff, since I thought it was needed, but it turned out it was just fine.

With those two things fixed, the shields now behave exactly how I wanted them to.

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
avatar image
5

Answer by krisventure · Feb 16, 2017 at 01:58 PM

Apparently, the issue described by @Utoxin has been fixed ever since. Now you can get billboards, not only meshes, to trigger OnParticleCollision(). My Particle System Collision settings are shown in the screenshot below, it works fine with billboards.

And the code in any of the scripts attached to the target objects hit by the particles:

 void OnParticleCollision(GameObject particleHolderObject) {        
         if (particleHolderObject.name == "MagicBullets") {
                   // your code
             }
  }


Note that it makes a huge difference that you don't need to waste your resources on meshes and the collision accuracy seemed to be more precise as I could allow much more particles with billboards than with meshes. More particles, more collisions, I guess that's why I got better detection like that.

alt text


screen-shot-2017-02-16-at-035207.png (20.3 kB)
Comment
Add comment · Show 1 · 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 JelmerV · May 14, 2018 at 01:15 PM 1
Share

wow, thanks so much, I was almost there, but needed to check "Send Collision $$anonymous$$essages". Without that screenshot, I would have never found that :D

avatar image
4

Answer by insoluzioni · May 14, 2020 at 04:14 AM

This is old, but my problem was that I forgot to check "Send Collision Messages" in the Collision Module of the Particle System inspector. Also, I can confirm that billboards will trigger the event as well.

alt text


anotacao-2020-05-14-011431.png (24.1 kB)
Comment
Add comment · Show 1 · 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 supendi42 · Jun 08, 2021 at 06:28 AM 0
Share

thanks! it works perfectly

avatar image
0

Answer by ArneSnackaert · Dec 28, 2021 at 03:09 PM

If anyone coming across this. I had send collision enabled. I had colliders on my objects as well as rigidbodies and it still didn't work. You have to make sure the script is on the same gameobject as the particle system.

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

9 People are following this question.

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

Related Questions

Shuriken collision with terrain? 0 Answers

Particle Collision in Shuriken - OnParticleCollision 2 Answers

Shuriken OnParticleCollision SendCollisionMessage doesn't work completely 0 Answers

Rotate a particle on collision? 0 Answers

Shuriken and OnCollisionParticle 1 Answer


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