# Implements IGumCollidable

### Introduction

Marking an entity as implementing IGumCollidable enables the creation of shapes for standard FlatRedBall collision using a Gum object. This can be useful for visually creating complex shapes in Gum, for aligning shapes with visuals created in Gum, or for implementing collision animation using the Gum animation system.

### Example - Creating Collision in Gum

The following example shows how to create shapes in Gum and use them as the entity's collision. This example will use a default Player using the top-down controls, however it can be used on any type of entity.

![](/files/it5QMVERnNa3caS3mEni)

First, we'll delete the existing collision from the entity since it is not needed - Gum will be responsible for adding collision:

<figure><img src="/files/EpaBbYmZn1RqOIPNLjP1" alt=""><figcaption></figcaption></figure>

Next, we'll define a Gum object which has collision. Keep in mind - any visuals will also be rendered on the entity, but for this example we'll use only shapes for collision.

![](/files/CzNaCCHEL3rZy36laIAm)

Gum objects can contain Circle and Rectangle instances, and these should not be rotated. Notice that the component uses the center alignment. The center of the FlatRedBall entity will line up with the center of the Gum entity. Once a Gum component has been created, it can be added to the Player object:

1. Right-click on the Player's **Objects** folder
2. Select **Add Object**
3. Select the **Gum** Object Type
4. Scroll down or search for the name of your Gum component - in this case **PlayerGumComponentRuntime**
5. Click **OK**

<figure><img src="/files/b6UjHisUoh9vKrSKdnhS" alt=""><figcaption></figcaption></figure>

Finally, verify that the Entity is both an ICollidable and IGumCollidable:

1. Select the entity
2. Select the **Properties** tab
3. Set ImplementsICollidable to True (this is usually true if the Player object was created by the wizard)
4. Set **ImplementsIGumCollidable** to **True**

![](/files/w0BT18Cmep3ktHFP7Xkv)

Now the Player object will have its Collision populated by any Circle and Rectangle instances from any Gum objects (in this case PlayerGumComponentRuntimeInstance). Setting the collision to Visible can be helpful for debugging. Add this code in the Player's CustomInitialize method:

```
private void CustomInitialize()
{
    this.Collision.Visible = true;
}
```

The Collision ShapeCollection will be visible and collides with solid collision.

<figure><img src="/files/2xZ2A1rsdQ1cC0GEI220" alt=""><figcaption></figcaption></figure>


---

# 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://docs.flatredball.com/flatredball/glue-reference/entities/implements-igumcollidable.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.
