I am trying to make a survival game but I can’t figure out how to make it so my character can destroy objects with tools/fists. I am making C# files for each destroyable GameObject, heres my first one:
using UnityEngine;
using System.Collections;
public class BigTree : MonoBehaviour {
int Health = 100;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Health == 0) {
Destroy (gameObject)
}
}
}
By the way, I just started messing around with Unity so my code is probably totally wrong.