# ExposedInDerived

### Introduction

The ExposedInDerived property on an object allows an object to be accessible in a derived Entity. This is useful if a base Entity defines that an object must exist (such as an AxisAlignedRectangle in a collidable entity), but the entity modifies its values (such as a derived enemy entity modifying the size of its collision). Objects which are ExposedInDerived will appear as normal white entities in the tree view, and objects which are created as a result of setting ExposedInDerived to true appear as green in derived entities. The following image shows an AxisAlignedRectangleInstance in BaseEntity which has its ExposedInDerived set to true. The AxisAlignedRectangleInstance in DerivedEntity is green to indicate that it is created in the base entity.

![](https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2Fgit-blob-fabf9a0c80c62a53b87e4b1f25c4a44616544e55%2F2021-05-img_60aa8c9f21571.png?alt=media)

### Object Access

Providing proper access to your objects can be a little complex at first, but it is the key to "scalability" (the property of being able to continually grow the size of your game while minimizing complexity). In short, there are three "levels" of access you can provide in Glue:

* No access in derived elements (default)
* ExposedInDerived set to true
* SetByDerived set to true

If no access is given, then an Entity's objects will be hidden from derived Entities. This allows derived entities to simply inherit a "closed" object. It is rare to have a base entity that does not provide access to any of its contained objects to a derived entity, but this option exists in case you want to limit access to some. ExposedInDerived allows you to access and modify an existing Object in a derived Entity, but you do not have access to set it to something different. This is common for Entities which include lists that are to be populated by derived Entities. You can also do things like change properties on ExposedInDeived objects. SetByDerived allows you to completely change an Object in an derived Entity. In this case, the base entity simply defines that an object *can exist* but the derived entity is responsible for actually defining this object. This can be used if the derived entity will create the object conditionally, or based on some other file (such as obtaining a collision object from a Gum component).


---

# 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/objects/glue-reference-exposedinderived.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.
