> For the complete documentation index, see [llms.txt](https://docs.streamavatars.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.streamavatars.com/lua-scripting-api/api-reference-and-tips/classes/app/getgameobject.md).

# getGameObject

```lua
function test()
    local id = get('objectId');
    local app = getApp();
    local ob = app.getGameObject(id);
end
objectId = '';
return function()
    local app = getApp();
    local myObject = app.createGameObject(); --objects can be used for adding images
    objectId = myObject.id;
    async('test');
end
```

{% hint style="info" %}
This is how you get objects to be shared between sub coroutines.
{% endhint %}

{% content-ref url="/pages/gqvM4178o3OeR3R3fEvX" %}
[applyImage](/lua-scripting-api/api-reference-and-tips/global-functions/applyimage.md)
{% endcontent-ref %}
