# Builtin variables

## entity

A variable called `entity` is automatically available to all scripts - it
represents the bevy entity that the `Script` component is attached to.
It exposes an `index` property that returns the bevy entity index.
It is useful for accessing the entity's components from scripts.
It can be used in the following way:
```js
print("Current entity index: " + entity.index);
```

The `entity` variable is currently not available within promise callbacks.
