# .isTouching not working

**URL:** <https://forum.code.org/t/istouching-not-working/32609>\
**Category:** Coding and Debugging Help\
**Created:** [April 28, 2020, 8:54pm UTC](https://forum.code.org/t/istouching-not-working/32609 "2020-04-28T20:54:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![clowe](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@clowe](https://forum.code.org/u/clowe)\
**Post date:** [April 28, 2020, 8:54pm UTC](https://forum.code.org/t/istouching-not-working/32609/1 "2020-04-28T20:54:36Z")

</div>

> **[Check out what I made](https://studio.code.org/projects/gamelab/WJE5StJUnpbGVtdAX6o3L7GAyRssVSjN7SXjBBKnrsg)**
>
> I wrote the code myself with Code.org

I expect .isTouching to run when the bunny touches the coin. I’m getting an error saying it is because it is only for sprites, when both my bunny and coin are sprites.

---

<div class="post-metadata">

**Author:** ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)\
**Post date:** [April 28, 2020, 9:53pm UTC](https://forum.code.org/t/istouching-not-working/32609/2 "2020-04-28T21:53:16Z")

</div>

Hi!

If you follow the program step by step, it first creates the coin sprite, then calls the function `setCoin`. That function checks to see whether the bunny is touching the coin, but the bunny has not been created yet. You can’t call a function that uses the bunny sprite before you create the bunny sprite. If you move the function call down to after the bunny is created, I think your program will work.

Elizabeth
