Hello guys, I have a new problem 
The problem is in collision and destroying my gameObject. I wrote the script:
using UnityEngine;
public class CollisionScript : MonoBehaviour {
void OnCollisionEnter2D(Collision2D other)
{
Destroy(gameObject);
}
}
I made spawner and sometimes it can spawn 2 objects that can be āone-on-oneā, so I decide to make special script. When they will spawn āone-on-oneā they will collide and then destroyed. In this way, I can avoid creating one-on-one objects.
But, the problem is that when they collide nothing happend. After some experiments I saw that the problem is in the āRigidBody2Dā - Kinematic body type and if a change it to Dynamic - all is ok and object destroy. I need to made it without onTriggerEnter2D.
Please, help me 
Not to troll, but you should probably fix the problem at hand. The one on one spawning problem.
Never a good idea to try and patch a problem instead of solving it.
If you post the spawning problem maybe someone can helpā¦
1 Like
The spawning problem in that that I have 3 methods. In these methods spawn of game objects occurs at random time for example Random.Range(1,3). So, I have 3 methods with 3 difficulties of spawning obstacles and problem the next:
for example: spawn of obstacles, then after 2sec must be next spawn of obstacles, but before when 2sec will last, probally could start another method(previous method will stopped) which will spawn new obstacles at this time and in this moment will be situation when obstacles will be āone-on-oneā.
Sorry for my English, itās not my native 
It can be funny, but I followed your advice and have solved problem for 15min 
Thank you.
1 Like