I have tried multiple times and ways to get this to work, even starting completely over on the project and remaking from scratch. I can not get the collision to work. Secondtry is my script that I made over after deleting the original brick script that didn’t work. I have checked every letter. Here is my stuff…
using UnityEngine;
using System.Collections;
public class secondtry : MonoBehaviour {
public int maxHits;
public int timesHit;
// Use this for initialization
void Start () {
timesHit = 0;
}
void Update(){
}
void onCollisionEnter2D (Collision2D col) {
Debug.Log ("hit");
timesHit++;
maxHits--;
}
}
My ball script
using UnityEngine;
using System.Collections;
public class Ball : MonoBehaviour {
public Paddle paddle;
private bool has_started = false;
private Vector3 paddleToBallVector;
void Start(){
paddleToBallVector = this.transform.position - paddle.transform.position;
}
// Update is called once per frame
void Update () {
if(!has_started){
this.transform.position = paddle.transform.position + paddleToBallVector;
if (Input.GetMouseButtonDown(0)){
has_started = true;
this.rigidbody2D.velocity = new Vector2(5f,10f);
}
}
}
}
Inspector on my 1 hit
Inspector on my ball
I’m nervous that is something simple, but I have spent to many hours trying to find it. I did mess with my gravity settings, there are currently at -5.


