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
0
Question by CoalCzar · Oct 21, 2013 at 10:15 PM · collisionparticlesystem

Shuriken collision detection is sparse

I'm having trouble with my particle collisions. They seem to happen much less frequently than it would seem they should. In this picture, the system has an emission rate of 100 and has been emitting for a few seconds already, but the collision detection has only registered three hits.

Here's my code for the particle system:

 using UnityEngine;
 using System.Collections;
 
 public class SprayGun : MonoBehaviour {
 
     public float freezeDecrement = 10.0f;
     private ParticleSystem prtSys;
     private CharacterInput scriptCharInput;
 
 
     void Start()
     {
         prtSys = GetComponent<ParticleSystem>();
         scriptCharInput = GameObject.Find("Character").GetComponent<CharacterInput>();
     }
 
     void OnParticleCollision(GameObject other)
     {
         ParticleSystem.CollisionEvent[] colEvents = new ParticleSystem.CollisionEvent[prtSys.safeCollisionEventSize];
 
         int numCollisionEvents = prtSys.GetCollisionEvents(other, colEvents);
         for (int i = 0; i < numCollisionEvents; i++)
         {
             if (colEvents[i].collider.name == "Character")
             {
                 scriptCharInput.xTransferEnergy -= freezeDecrement * Time.deltaTime;
                 print("BOOM");
             }
         }
     }
 }

Any ideas? Does it have anything to do with using World (currently selected) vs Plane collision? I couldn't find any good documentation explaining the difference.

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
0

Answer by Cherno · Oct 21, 2013 at 11:01 PM

World Collision means that the particles will collide with any colliders that are in one of the layers specified in the dialog. Plane means just that, you have to specify which planes in your scene will act as colliders (I guess it's only rarely useful, such as when there's a completely flat ground). You can also, if using world, set the collision quality to high and see if that helps.

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 CoalCzar · Oct 21, 2013 at 11:34 PM 0
Share

Thanks. I do have my collision set to High, so I'm not sure where to look next. It also doesn't seem to matter if they are billboards or cubes.

avatar image Cherno · Oct 21, 2013 at 11:40 PM 0
Share

$$anonymous$$aybe do a purely visual approach for testing purposes. Disable the script, and just set up everything in the Collision dialog of the Particle System, and see if the particles hitting colliders actually fall through without colliding or if most of them stop. Then you at least know if it's a script or general issue. For this case, the plane collison might come in handy for once :)

avatar image CoalCzar · Oct 23, 2013 at 02:21 PM 0
Share

The particles are definitely colliding a lot, but with the ground mostly. It's not a problem of collision.

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

15 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

Related Questions

Make particles stay on ground 0 Answers

How to destroy object when it collides particle 1 Answer

Getting the position/intersection of collided particles 1 Answer

Transforming and playing particle effects? Help! 1 Answer

Particle System Collision: Collisions and Trigger 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