---
title: Checking if a character is on the ground
slug: world-sdk-guide/checking-if-a-character-is-on-the-ground
docTags: 
createdAt: 2024-09-02T08:34:13.135Z
---

In this guide, we will show you how to check if the local player's Zepeto character is on the ground based on the `isGrounded` function provided by Unity.

:::hint{type="info"}
**📘 CharacterController.isGrounded**
[https://docs.unity3d.com/ScriptReference/CharacterController-isGrounded.html](https://docs.unity3d.com/ScriptReference/CharacterController-isGrounded.html)
:::



### STEP 1 : Write a script

- Add a GameObject to the Scene and add the IsGrounded example script below.

```typescript
import { ZepetoScriptBehaviour } from 'ZEPETO.Script'
import { ZepetoPlayers } from 'ZEPETO.Character.Controller';
import { Text } from 'UnityEngine.UI';
 
export default class IsGrounded extends ZepetoScriptBehaviour {
 
    public myText: Text;
 
    Update() {
        // Access the local player's character controller
        const localCharacter = ZepetoPlayers.instance.LocalPlayer.zepetoPlayer.character.characterController;
 
        // Check if the character controller is touching another collider using isGrounded
        if (localCharacter.isGrounded) {
            this.myText.text = "Character is on the Ground";
        } else {
            this.myText.text = "Character is NOT on the Ground";
        }
    }
}
```



### STEP 2 : Setting up Text UI

- Add UI > Text to the Scene.
- In the Hierachy window, connect the Canvas > Text component to the Property displayed in the ZEPETOScript Inspector window by dragging and dropping.

![](https://api.archbee.com/api/optimize/fCt3n1oCa8rgNJ8fw9I2N-RAHCk3c5aUhBdI87eYIYW-20240904-102412.png)



### STEP 3 : Run

- If you press the Play button to run it, you can check whether the character is on the floor through the Text UI.

![](https://api.archbee.com/api/optimize/fCt3n1oCa8rgNJ8fw9I2N-BOg7zNYsCpf2rw-nVr_Hr-20240904-102412.gif)

