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
0
Question by Mattolio · Sep 12, 2013 at 10:35 PM · particlesparticle collision

Wrong particle system playing with OnParticleCollision call - how do I call different particle systems using a single particle collision JS?

Hi

I'll start by explaining exactly how I have things set up - just in case it helps (old QA habits).

I have a scene where I control a cylinder with the third person controller, which has a particle system child playing on it. So when I move around, the particle system comes with me. It is essentially a flame which emits straight up on the y axis. I have a script on this particle system which detects particle collisions with a tagged game object (a cube). When that collision is detected (which it is, that is working ok), I trigger a particle system on the cube to begin playing (to emulate an effect where my flame has caused the cube to set on fire). I trigger the particle system on the cube by basically calling a function to play it from another JS.

When I then duplicate the cube - and link the new particle system to it in the inspector, I expect that it should then call that particle system I have linked instead of the original one on the original cube.

The behavior I am seeing though is that when I burn the new box, it triggers the particle system for the original box instead. Box one continues to burn as expected if collided with, but box 2 does not - instead triggering the particle system on box 1. The only thing that does fire as expected is the cylinders particle collisions with the new box.

I must be missing something so obvious, im a bit of a n00b, but im struggling with the logic. If I drag and drop the new cube's particle system into the inspector, surely thats the one which should be linked and not the first one?! Please help im going mad.

Heres the code on the player's particle system:

 var boxFire : boxFire;
 
 function OnParticleCollision (collision : GameObject) {
     if (collision.transform.tag == "BurnBox") {
         Debug.Log ("Particle collisions detected for box!");
             boxFire.startFire();
     }
 }

Here is the code on the cube:

 var boxParticleSys : ParticleSystem;
 
 
 function startFire(){
     Debug.Log ("Starting the fire for box!");
     boxParticleSys.Play();
 
 }

Thanks for taking a look!

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

0 Replies

· Add your reply
  • Sort: 

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

Whirlwind spell collision detection 1 Answer

Detecting collision between particle and player. 2 Answers

How to simply enable an objects particle system emission when that object collides with another? 1 Answer

OnParticleCollision not responding! 0 Answers

Let Particles sit on Collider without triggering callback - OnParticleCollisionEnter? . 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