Collision Issue! PLEASE GUYS HELP ME!

I want to create a game like BubbleShooter and when i shoot a bubble (as u can see in the image) the Console shows a message with the colliders the bubble hit.
But i dont get why there are so many colliders when i only hit one bubble?
Thank you in advance

Script:

public class PopBubble : MonoBehaviour {

PlayerController player;

void Start()
{
    GameObject playerobject = GameObject.FindWithTag("Player");

    player = playerobject.GetComponent<PlayerController>();
}

void OnCollisionEnter(Collision other)
{
    if(other.collider.gameObject.name == player.instantiatedobj.name)
    {
        //Destroy(other.gameObject);

        //Destroy(player.instantiatedobj);

        Debug.Log("collide (start)(name) : " + other.collider.gameObject.name);
        Debug.Log("collide (start)(tag) : " + other.collider.gameObject.tag);

        Debug.Log("collide (shoot)(name) : " + player.instantiatedobj.name);
        Debug.Log("collide (shoot)(tag) : " + player.instantiatedobj.tag);

    }
    else 
    {
        Debug.Log("collide (start)(name) : " + other.collider.gameObject.name);
        Debug.Log("collide (start)(tag) : " + other.collider.gameObject.tag);

        Debug.Log("collide (shoot)(name) : " + player.instantiatedobj.name);
        Debug.Log("collide (shoot)(tag) : " + player.instantiatedobj.tag);

        player.instantiatedobj.GetComponent<PopBubble>().enabled = false;

    }
}

}

public class Test {

PlayerController player;
private Collider lastHitCollider;

void Start() {
	GameObject playerobject = GameObject.FindWithTag("Player");
	player = playerobject.GetComponent<PlayerController>();
}

void OnCollisionEnter(Collision other) {
	if(other.collider.gameObject.name == player.instantiatedobj.name) {
		//Destroy(other.gameObject);
		//Destroy(player.instantiatedobj);
	} else {
		// save other
		if(!other.collider.Equals(lastHitCollider)){
			player.instantiatedobj.GetComponent<PopBubble>().enabled = false;
			lastHitCollider = other.collider;
		}
	}
}

}

here i am just saving the collider and seeing if it has changed don’t know if it will help or not though.

From what I can see. I would have to guess that your bubble objects. Are likely already in a collision state from the start. Or get bumped into eachother after the first collision.
IE: Your bubbles at the top already touch each other. Triggering OnCollisionEnter on all of them right from the get go. If you don’t get the onslaught of debug.log until you fire then likely your shooting ball is bumping your objects into each other. Not sure at which point you screenshot was taken.

Few things could fix this. Either give them enough spacing to not bump colliders. Or go into your project settings and modify your 3d physics options. Set it so all of the target bubbles are in one layer that doesn’t interact with itself. Then make sure your shooting ball is in a layer that does interact with the bubbles layer. Also you could check in your collision code if the collision was with another bubble, do nothing, else your shooting ball was the collision and delete both.

Best guess from what is here. Try your scripts in a scene with just one bubble. if your results are as you expect then likely you just need to make your bubbles not interact with each other.

Thank you guys!
Your answers helped me a lot and now i can continue with my game :smiley: