ドキュメント

Unity Engine

Unity Engine

isGrounded

Was the CharacterController touching the ground during the last move?
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
public bool isGrounded { get; }

Remarks

Indicates whether the CharacterController was touching the ground during the most recent call to CharacterController.Move or CharacterController.SimpleMove.
This property is updated after each call to Move, based on collision detection with the ground. It returns true if the controller collided with any object below it during the movement — typically used to determine if the character is standing on a surface (e.g., terrain, platform, floor).

Examples

using UnityEngine;public class Example : MonoBehaviour{ CharacterController characterController; void Start() { characterController = GetComponent<CharacterController>(); } void Update() { if (characterController.isGrounded) { print("CharacterController is grounded"); } }}