# How should resource.atlas(\[path\]) work?

**URL:** <https://forum.defold.com/t/how-should-resource-atlas-path-work/78467>\
**Category:** Questions\
**Created:** [October 17, 2024, 6:52pm UTC](https://forum.defold.com/t/how-should-resource-atlas-path-work/78467 "2024-10-17T18:52:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![n0ut4j4](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/n0ut4j4/32/37762_2.png) [@n0ut4j4](https://forum.defold.com/u/n0ut4j4)\
**Post date:** [October 17, 2024, 6:52pm UTC](https://forum.defold.com/t/how-should-resource-atlas-path-work/78467/1 "2024-10-17T18:52:04Z")

</div>

Total n00b here. I’m trying to use an atlas to select images for game object sprite. I tried to study the API and I came up with this line

go.property(“types”, resource.atlas(“/main.atlas”))

Now, there’s a main.atlas (actually from a template) in the main folder. But I get a build error

/main/pala.script  
Types ‘/main.atlas’ could not be found

Why is it not being found? Also, I’m not sure if this is the best way to pick different sprites. But this was the only example in the docs I found. Is there a direct way to address the images?

go.set(“#sprite”, “image”, [something])

Thanks for any help

---

<div class="post-metadata">

**Author:** ![Halfstar](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/halfstar/32/26587_2.png) [@Halfstar](https://forum.defold.com/u/Halfstar)\
**Post date:** [October 17, 2024, 7:34pm UTC](https://forum.defold.com/t/how-should-resource-atlas-path-work/78467/2 "2024-10-17T19:34:45Z")

</div>

> [@n0ut4j4](#):
>
> Now, there’s a main.atlas (actually from a template) in the main folder.

In the main folder, as in `your_project/main/main.atlas`? You are addressing the root folder, so you have to use

```lua
go.property("types", resource.atlas("/main/main.atlas"))

```

Also, if you just want to pick a sprite, you can put multiple images into the atlas, and use [sprite.play\_flipbook()](https://defold.com/ref/stable/sprite/#sprite.play_flipbook:url-id-%5Bcomplete_function%5D-%5Bplay_properties%5D):

```lua
sprite.play_flipbook("#my_sprite", "jumping")

```
