LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

This version of Unity is unsupported.

CharacterController.isGrounded

Switch to Manual
public bool isGrounded;

Description

Was the CharacterController touching the ground during the last move?

using UnityEngine;

public class Example : MonoBehaviour { CharacterController controller;

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

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