# Is touching command error-Unit 3

**URL:** <https://forum.code.org/t/is-touching-command-error-unit-3/34797>\
**Category:** Coding and Debugging Help\
**Created:** [June 8, 2021, 4:10pm UTC](https://forum.code.org/t/is-touching-command-error-unit-3/34797 "2021-06-08T16:10:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lkling](https://avatars.discourse-cdn.com/v4/letter/l/3da27b/32.png) [@lkling](https://forum.code.org/u/lkling)\
**Post date:** [June 8, 2021, 4:10pm UTC](https://forum.code.org/t/is-touching-command-error-unit-3/34797/1 "2021-06-08T16:10:35Z")

</div>

In line 94, there is a bug saying “Is touching is not a function”. Can anyone debug this?

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [June 8, 2021, 4:34pm UTC](https://forum.code.org/t/is-touching-command-error-unit-3/34797/2 "2021-06-08T16:34:58Z")

</div>

@lkling,

Do you have a link?

Mike

---

<div class="post-metadata">

**Author:** ![lkling](https://avatars.discourse-cdn.com/v4/letter/l/3da27b/32.png) [@lkling](https://forum.code.org/u/lkling)\
**Post date:** [June 8, 2021, 5:43pm UTC](https://forum.code.org/t/is-touching-command-error-unit-3/34797/3 "2021-06-08T17:43:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lkling](https://avatars.discourse-cdn.com/v4/letter/l/3da27b/32.png) [@lkling](https://forum.code.org/u/lkling)\
**Post date:** [June 8, 2021, 5:44pm UTC](https://forum.code.org/t/is-touching-command-error-unit-3/34797/4 "2021-06-08T17:44:16Z")

</div>

Here is the code:

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

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [June 8, 2021, 5:54pm UTC](https://forum.code.org/t/is-touching-command-error-unit-3/34797/5 "2021-06-08T17:54:12Z")

</div>

@lkling,

Between lines 78 & 97, the code is attempting to redefine not just Car4, but also car3 as a random number (and no longer a sprite).

I think you are missing. the .x and .y notation on all of the random number lines between 78 & 97.

Good luck!

Mike

---

<div class="post-metadata">

**Author:** ![lkling](https://avatars.discourse-cdn.com/v4/letter/l/3da27b/32.png) [@lkling](https://forum.code.org/u/lkling)\
**Post date:** [June 8, 2021, 6:14pm UTC](https://forum.code.org/t/is-touching-command-error-unit-3/34797/6 "2021-06-08T18:14:34Z")

</div>

[https://studio.code.org/projects/gamelab/LQuSovvJ5\_4mOMLmscPUcSDlpfg\_eVNsBf7jjH-3Iuo](https://studio.code.org/projects/gamelab/LQuSovvJ5_4mOMLmscPUcSDlpfg_eVNsBf7jjH-3Iuo)

**Mrs. Kling-Ortiz**  
**KMS**  **STEM Lab, Computer Science, and Computer Applications Teacher**  
**_Room 901 and Room 603_**

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [June 8, 2021, 7:14pm UTC](https://forum.code.org/t/is-touching-command-error-unit-3/34797/7 "2021-06-08T19:14:03Z")

</div>

I did find the source of the error … if you didn’t see it, I did post what I found above.

> [@Is touching command error-Unit 3](https://forum.code.org/t/is-touching-command-error-unit-3/34797/5):
>
> @lkling, Between lines 78 & 97, the code is attempting to redefine not just Car4, but also car3 as a random number (and no longer a sprite). I think you are missing. the .x and .y notation on all of the random number lines between 78 & 97. Good luck! Mike

thanks,

Mike

---

<div class="post-metadata">

**Author:** ![lkling](https://avatars.discourse-cdn.com/v4/letter/l/3da27b/32.png) [@lkling](https://forum.code.org/u/lkling)\
**Post date:** [June 8, 2021, 7:24pm UTC](https://forum.code.org/t/is-touching-command-error-unit-3/34797/8 "2021-06-08T19:24:37Z")

</div>

Yes, that looks like the issue. I will forward this to my student. Thanks!
