# Bug: Cannot read property

**URL:** <https://forum.code.org/t/bug-cannot-read-property/32196>\
**Category:** Coding and Debugging Help\
**Created:** [February 4, 2020, 7:05pm UTC](https://forum.code.org/t/bug-cannot-read-property/32196 "2020-02-04T19:05:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam.barnhart](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@sam.barnhart](https://forum.code.org/u/sam.barnhart)\
**Post date:** [February 4, 2020, 7:05pm UTC](https://forum.code.org/t/bug-cannot-read-property/32196/1 "2020-02-04T19:05:23Z")

</div>

This is a students code and I can’t figure out what is causing the bug. Any help is much appreciated.

**Link to the project or level:** [https://studio.code.org/projects/gamelab/wkk640QHsbEtiz4f5ZqhV7Z5aTOl1JVwMunNTPKHFYM](https://studio.code.org/projects/gamelab/wkk640QHsbEtiz4f5ZqhV7Z5aTOl1JVwMunNTPKHFYM)  
**What I expect to happen:** if enemy1 touches the cake, the enemy and score respond  
**What actually happens:** getting a bug "Cannot read property ‘isTouching’ of undefined  
**What I’ve tried:** deleting parts of the insides of the function, checked variables at the beginning

---

<div class="post-metadata">

**Author:** ![mkmietowicz](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mkmietowicz/32/6322_2.png) [@mkmietowicz](https://forum.code.org/u/mkmietowicz)\
**Post date:** [February 5, 2020, 5:16am UTC](https://forum.code.org/t/bug-cannot-read-property/32196/2 "2020-02-05T05:16:23Z")

</div>

Hi @sam.barnhart,

Can you double-check the link you put in here? I’ve tried opening it in two different browsers but it’s not working for me, even with browser refresh:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/3/3fbc4c4d427b2275c3ce6fdeeeb57164f4cce04b.png)

Thanks,  
–Michael K.
