- Home /
How to prevent multiple collision?
If you connect several objects, then they should turn into one another. These objects are completely identical. This works fine when the object is only 2. I use OnCollisionEnter().
The issue arises when one object falls on several objects (as shown in the figure). 2 new objects appear, but there should be 1 new and 1 to remain old.
I dont get what are you asking.... Well, i dont get your "schema" nor explanation...
I want to create an inventory similar to this one.
https://www.youtube.com/watch?v=Jh5yiuNhj1$$anonymous$$
When an identical object collides with another, it must create a pack of these objects. This works when I need to connect them only 2. But when there are more than two objects touching each other at the same time, several packs are created simultaneously.
The picture shows an example when 2 single premes lie on the floor and the same single object falls on them. They collide at the same time and from them 2 packs turn out. That is, there are 3 items in total, and after that they get 2 * 2 = 4 (2 packs of 2 single items). I suppose this is due to the fact that the method OnCollisionEnter() works simultaneously on all objects.
Is there any way to prevent a simultaneous script call or something like that?