Here is my C# script that is attached to my coins. The error is on (4,6)
using UnityEngine;
using System.Collections;
void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag == "Coin")
{
other.gameObject.SetActive = false;
}
}
Here is my C# script that is attached to my coins. The error is on (4,6)
using UnityEngine;
using System.Collections;
void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag == "Coin")
{
other.gameObject.SetActive = false;
}
}
you need to wrap a class around your OnTriggerEnter function like this:
using UnityEngine;
using System.Collections;
public class MyClassName : MonoBehaviour {
void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag == "Coin")
{
other.gameObject.SetActive = false;
}
}
}