This is what i have so far, but i keep getting the error message "'GroundDetector.GroundCollider' is a 'field' but a 'type' was expected." All i'm trying to do is to set the public Collider to the three trigger events below (OnTriggerEnter, OnTriggerStay, OnTriggerExit)
using UnityEngine;
using System.Collections;
public class GroundDetector : MonoBehaviour
{
private bool onground;
public Collider GroundCollider;
void Start()
{
GroundCollider = GetComponent();
}
void OnTriggerEnter(GroundCollider other)
{
onground = true;
}
void OnTriggerStay(GroundCollider other)
{
onground = true;
}
void OnTriggerExit(GroundCollider other)
{
onground = false;
}
}
↧