# Use the character information (with examples)

The term information here covers everything related to public getters and flags such as collision flags, physics contacts, triggers, grounding status, and so on. These values can be very useful when creating new gameplay mechanics.

## Grounded state

```csharp
if (CharacterActor.IsGrounded)
{
    DoGroundLogic();
}
```

## Wall collision example

The same can be applied to some other property, for example, if we need to trigger some animation parameter only when the character is touching a wall:

```csharp
if (CharacterActor.WallCollision)
{
    // Do wall collision logic.
}
```

## Wall running behavior

```csharp
if (!CharacterActor.IsGrounded && CharacterActor.WallCollision)
{
    // Do grounded logic.
}
```

## Slide movement

Let's say our character is standing on a steep slope (unstable state) and we want to make it slide down. What we can do is getting the unstable state first and then applying the movement.

```csharp
if (!CharacterActor.IsStable)
{
    // Do Slide
}
```

However, the character can be unstable while it's in the air, so we need to be sure the character is grounded as well:

```csharp
if (!CharacterActor.IsStable && CharacterActor.IsGrounded)
{
    // Do Slide
}
```

We can simplify this condition by using the *CurrentState* property from the actor (for more information please read the [States](/ccp/fundamentals/untitled/character-actor/stability.md#states) section).

```csharp
if (CharacterActor.CurrentState == CharacterActorState.UnstableGrounded)
{
    // Do Slide
}
```

Now, lets add one more condition. We want to execute the slide movement 1 second after making contact with this unstable surface. One way to do this is by using a property called *GroundedTime* (you have also *NotGroundedTime*, *StableGroundedTime* and *UnstableGroundedTime*).

```csharp
if (CharacterActor.CurrentState == CharacterActorState.UnstableGrounded)
{
    if (CharacterActor.GroundedTime >= 1f)
    {
        // Do Slide
    }    
}
```

Making the character slide is very simple. Based on [this](/ccp/fundamentals/untitled/character-actor/stability.md#stability) section, we know that only collide and slide is applied to the character. So, we need to move the character downwards, the collide and slide algorithm will handle that for us (also, the physics simulation does the same thing).&#x20;

So, this is the final code:

```csharp
if( CharacterActor.CurrentState == CharacterActorState.UnstableGrounded )
{
    if( CharacterActor.GroundedTime >= 1f )
    {
        CharacterActor.Velocity += - CharacterActor.Up * slideAcceleration * Time.deltaTime;
    }    
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lightbug14.gitbook.io/ccp/how-to.../core/use-the-character-information.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
