I’m working on a Pong-like game in 2D. All physics is done with some Box Collider 2D and a RigidBody 2D on the ball. Everything worked well before. With the new update, 5.3, the game engine seems to fail to detect collisions on Box Collider 2D when they move. To be more precise, all collisions on the border of the screens works well with a Box Collider 2D, but the one on the player and the IA, also with some Box Collider 2D, seems to work completly randomly, nearly never detected, maybe around 1/10 collisions are detected. The ball bounce off everything, as if a collision is dectected.
This code print normally when colliding with a wall, but around 1/10 or even less of the time when colliding with the player and IA. The only way to have collisions detected is to put the ball’s collision detection to “Continuous” but it’s overkilling some features of my game ( You can’t beat the IA, the only way you have to win is to have enough chance to have the ball go trought the IA’s collider at very high speed ).
I was working on this project with the Linux beta version of the Editor, everything worked well on the 5.2.X release ( the last one ). My problems started when upgrading to 5.3 and going back to Windows.
I don’t really know if it’s a new behavior due to the 2D physic upgrade for particles or a bug, so I didn’t have done a bug report. Maybe I have to do my physics with rigidbody now or by another way, I did not checked the docs if something changed. I’ve done it as usual I do with 2D physics.
I’ve just tried again the old version of my game on my Linux laptop using the 5.2.2f1 release ( latest Linux beta build available at this time. ) and it works just fine. The same code print on each collision. This problem appeared after I’ve added some 2D particles systems on my ball. I can’t make a bug report right now but I will do it this afternoon around 14:00. Thanks for checking this bug if it’s one.
If the 2D physics didn’t changed, then I may have messed something in my project. I will check everything up when I’ll can. I hope I did not make any error and took your time for nothing.
It’s never a waste of time. All bug reports are useful. I was really just trying to highlight that the issue may have started before 5.3 being as the recent problem was there in 5.2.3p3.
I did not used the 5.2.3p3 version, I’ve jumped from 5.2.2f1 on Ubuntu Linux to 5.3 on Windows, so I can’t say if that started with the 5.2.3p3 version. If this problem started in this version, then my problem is maybe the same.
I was just about to post about this as well. The problem for us started with any version past 5.2.2 as MelvMay suggested.
One use case we’re having trouble with is when a trigger is animated with Mecanim, the collision is simply not registered.
If a trigger is spawned on top of another animated trigger, the collision will occur.
If a trigger is spawned and then moved into the animated trigger, the collision will fail.
I’ve attached a small test project where we can replicated this consistently on 5.3.0f4. If you open the Test scene and press space, you will see the collision fail. If you turn off the Animator component on the Target object and play the scene, the bullets will now hit without the trigger on the Target object animating.
We’re also having issues with some cases where collisions don’t register post 5.2.2 without adding a Rigidbody2D on all the involved objects, but we haven’t looked into this as much to provide a test case.
Edit:
I’ve submitted a separate bug report in case this is not a duplicate: 753232