using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Bricks : MonoBehaviour {
private LevelManager levelManager;
public int timesHit;
private int maxHits;
// Use this for initialization
void Start() {
timesHit = 0;
levelManager = GameObject.FindObjectOfType<LevelManager>();
}
// Update is called once per frame
void Update() {
}
void OnCollisionEnter2D(Collision2D col) {
timesHit++;
if (timesHit >= maxHits) {
Destroy(gameObject);
}
}
}
Iāve double checked that my block prefabs have the āBrick scriptā attached so I figured iām doing something wrong on the script end of things. Anyone notice something iām not on my script?