Answers for "isGrounded script for copy"

C#
0

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;
     }
   }
}
Posted by: Guest on May-17-2020

C# Answers by Framework

Browse Popular Code Answers by Language