public bool isGrounded ;

Description

在上次移动期间 CharacterController 是否接触地面?

using UnityEngine;

public class Example : MonoBehaviour { CharacterController controller;

void Start() { controller = GetComponent<CharacterController>(); }

void Update() { if (controller.isGrounded) { print("CharacterController is grounded"); } } }