- Home /
What could cause OnParticleCollision to fail?
I just upgraded to Unity 5.2.
I previously had ZERO problems with this attached to a gameObject that gets hit from a particle:
function OnParticleCollision (other : GameObject) {
print(other.name);
}
But after the upgrade, it seems the event is occasionally not firing :/
Can you upload an example project that works in 5.1 but not 5.2?
@karl.jones
Could be difficult as it may not open now that Unity 5.2 has upgraded my project. I will see when I get home if I can jump to a previous version, confirm and upload.
@karl.jones
Hi man, sorry I took so long to get back on this.
Here are the two projects, isolated.
test THIS one in 5.1 https://dl.dropboxusercontent.com/u/94673481/sad_bugginess_sad_face/_5_1_test.zip
and THIS one in 5.2 https://dl.dropboxusercontent.com/u/94673481/sad_bugginess_sad_face/_5_2_test.zip
I stripped all the other levels out to save on file-size and isolate the problem. I apologize that the scripts are all over the place. I've been rapid-prototyping. For your convenience I have placed a Debug.Log() which will help you identify which part of the script you need to access.
The main GameObject I'm worried about is called "Player".
The other gameObjects we're worried about can be found in "EggController/Cannons" And "PowerUpSpawner" These are the particleSystems that should be colliding with the player. The easiest ones to notice are the Powerups that occasionally fall from the sky, they're the easiest ones to test this bug with.
Notice they work just fine in 5.1, but occasionally will miss in 5.2. I wonder if it is actually the collider that is failing? As opposed to OnParticleCollision()?
To play, you can use a PS4 controller or computer keyboard Controls:
Character projectiles will "auto-fire".
All you have to do is move left and right
The game is designed for "pressing the buttons as fast as you can" so... to move, you must button-mash left/right.
I hope the controls make sense :) Enter-$$anonymous$$ey or X(PS4) to start the game.
I'm gonna saw my feet off if I can't get things goin in 5.2, because WebGL has gotten so much better, im almost considering building to it! If not for this particle bug :/
Answer by Enlil5 · Sep 19, 2015 at 03:33 AM
I don't know if it is directly related, but it seems like something broke or at least seriously changed between 5.1 and 5.2 - before, particles broke if they were hit or hit a collider, now they only seem to break if the particle hits the collider. I submitted a bug report at 728693. The difference can be seen by downloading the projects below and running ParticleCollisionProblems5.1 in 5.1 and the ParticleCollisionProblems5.2 in 5.2 link text
Yeah I also sent them isolated scenes with 5.1 / 5.2 versions. They got back to me on my bug report saying they were able to reproduce the bug and that the problem has been reported to dev $$anonymous$$m. They also said though that they can't offer any timeframe in whcih they think it will be addressed. 5.3 is out in December, maybe then??
Spoke to the particle $$anonymous$$m, they believe they know what the problem is so hopefully we can get it fixed and pushed into a patch release. $$anonymous$$eep an eye on the patch release notes ;)
Thanks, $$anonymous$$arl! I've worked on a core engine $$anonymous$$m at a large studio myself so am usually thinking with some understanding that I shouldn't expect a fix terribly soon, but I'm filled with joy to have positive responses from you and from the guy who promptly replied to my bug report.
All the best, Regan