Question by
Jeroeno_Boy · May 11, 2016 at 05:31 PM ·
c#collider
Help me please!!!
i have some problems with my miniral script, some info here:
Prefab, Collider , Collider , rigidbody, dropped by mine, molten at furnace.
using UnityEngine;
using System.Collections;
public class Iron : MonoBehaviour {
private float Worth = 1;
MoneyMaker MM;
void Start ()
{
MM = GetComponent<MoneyMaker>();
}
void OnTriggerEnter(Collider col)
{
if (col.gameObject.tag == "BasicFurnace")
{
MM.Money += Worth;
Destroy (this);
}
}
}
Problem: it gives a error at the OnTriggerEnter
Comment