I'm trying to assign a public collider to some trigger events, but i keep getting "'GroundDetector.GroundCollider' is a 'field' but a 'type' was expected." message.

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<Collider>();



    }
    void OnTriggerEnter(GroundCollider other)
    {

        onground = true;
    }
    void OnTriggerStay(GroundCollider other)
    {

        onground = true;
    }
    void OnTriggerExit(GroundCollider other)
    {

        onground = false;
    }
}

For OnTriggerEnter, OnTriggerStay, and OnTriggerExit, you must write Collider instead of GroundCollider as the type of “other”. GroundCollider, as the error states, is a field (not a type), and parameters need to be declared with a type.

If the desired behavior is to ignore the OnTrigger*** methods when the other collider is not GroundCollider, putting the following at the beginning of each function will do the trick:

if (other != GroundCollider) {
    return;
}