[SOLVED] Ball looses energy after hitting specific double blocks

Hey, guys. I’m testing a specific Scene here and I realised the ball is drastically loosing energy only after hitting two bricks at once. But it’s strange because it seems a little random. Sometimes it happens with different bricks and I could recreate this same condition only in one of my scenes.

lazy_ball

I checked the bank material and bounciness is 1, friction 0.

Ball script also looks fine:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Seed : MonoBehaviour {


private Joint joint;  
private bool hasStarted = false;

private Vector3 jointToSeedVector;

	// Use this for initialization
	void Start () {

	joint = GameObject.FindObjectOfType<Joint>();
	jointToSeedVector = this.transform.position - joint.transform.position;
		
	}
	
	// Update is called once per frame
	void Update ()
	{
		if (!hasStarted) {
			this.transform.position = joint.transform.position + jointToSeedVector;
			if (Input.GetMouseButtonDown (0)) {
				print ("Mouse Button pressed");
				hasStarted = true;
				this.GetComponent<Rigidbody2D>().velocity = new Vector2 (2f, 10f);

			}
		}	
	}
}

I have no idea what may be causing this. Any thoughts? :slight_smile:

Hello there, can you check if those bricks arent duplicated in the scene (one on top of another)? This could cause this problem. Other things that could be caua this is really strange settings in the brick’s rigidbody.

Thanks, man! I realised I had the Box Collider 2D slightly smaller than the brick so there was a gap between bricks. I fixed the Box Collider size and now it’s working fine!

1 Like

Glad to know that you found the solution to the problem :smiley:

Privacy & Terms