isGrounded script for copy
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Example : MonoBehaviour {
Rigidbody rigid;
bool IsGrounded;
void Start () {
rigid = GetComponent<Rigidbody>();
}
void Update () {
if (rigid.velocity.y == 0){
IsGrounded = true;
}
else{
IsGrounded = false;
}
}
}