# Unit 3 Lesson 27 Debug Help

**URL:** https://forum.code.org/t/unit-3-lesson-27-debug-help/35566
**Category:** Coding and Debugging Help
**Created:** [December 10, 2021, 5:56pm UTC](https://forum.code.org/t/unit-3-lesson-27-debug-help/35566 "2021-12-10T17:56:52Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![stephanie.hodgson](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@stephanie.hodgson](https://forum.code.org/u/stephanie.hodgson)
#### Post date: [December 10, 2021, 5:56pm UTC](https://forum.code.org/t/unit-3-lesson-27-debug-help/35566/1 "2021-12-10T17:56:52Z")

</div>

I have a student trying to get their character to change animation when the “g” key it hit. Everything appears to work except that part. The character doesn’t change. It will move left and right when the D and A keys are pressed. Also, his score will not increase as the game goes on as well. Any help would be much appreciated.  
Here is a link to the project: [Code.org](https://studio.code.org/s/csd3-2021/lessons/27/levels/2)

Stephanie

---

<div class="post-metadata">

### Author: ![melynn](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/melynn/32/4925_2.png) [@melynn](https://forum.code.org/u/melynn)
#### Post date: [December 10, 2021, 6:45pm UTC](https://forum.code.org/t/unit-3-lesson-27-debug-help/35566/2 "2021-12-10T18:45:45Z")

</div>

Hi @stephanie.hodgson,

Can you click the SHARE button on his project and then share that link? When I click on the link you posted, it just takes me to my Unit 3, Lesson 27, Bubble 2 - I can’t see your student’s project. Thanks.

~Michelle

---

<div class="post-metadata">

### Author: ![stephanie.hodgson](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@stephanie.hodgson](https://forum.code.org/u/stephanie.hodgson)
#### Post date: [December 10, 2021, 8:26pm UTC](https://forum.code.org/t/unit-3-lesson-27-debug-help/35566/3 "2021-12-10T20:26:27Z")

</div>

Sorry about that. I thought that was the link they gave me.

Here is the shared link: [https://studio.code.org/projects/gamelab/U1Z19ZtG0\_8Sh59uxVSGJUio3G73FckdxX4dterlOPM](https://studio.code.org/projects/gamelab/U1Z19ZtG0_8Sh59uxVSGJUio3G73FckdxX4dterlOPM)

---

<div class="post-metadata">

### Author: ![melynn](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/melynn/32/4925_2.png) [@melynn](https://forum.code.org/u/melynn)
#### Post date: [December 10, 2021, 10:23pm UTC](https://forum.code.org/t/unit-3-lesson-27-debug-help/35566/4 "2021-12-10T22:23:08Z")

</div>

@stephanie.hodgson,

It was hard to see the differences in the sprites! I had to scale it x 2. The other troubleshooting step I took was to try to switch it with a really different sprite so I knew for sure it wasn’t working and it was not. I placed a console.log in the function that is supposed to change the animation and it did run meaning the function is running but the animation isn’t changing. So, when that happens I think about what is also running that is opposing the animation change.

On line 69, I see an else and if the else is triggering, the animation for _Jim_ is always animation\_1 so he won’t change to _gun_. I don’t think you need the else statement on line 69 because the default animation is animation\_1. In my mind, if the g key is down, then the animation is _gun_, else it is animation 1 (so try moving the else statement that changes the animation to _gun_ to the conditional with the g key).

Hope that makes sense. Good luck!  
~Michelle

---

<div class="post-metadata">

### Author: ![stephanie.hodgson](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@stephanie.hodgson](https://forum.code.org/u/stephanie.hodgson)
#### Post date: [December 13, 2021, 5:23pm UTC](https://forum.code.org/t/unit-3-lesson-27-debug-help/35566/5 "2021-12-13T17:23:22Z")

</div>

Thank you. We are going to give it a try.

Stephanie

---

<div class="post-metadata">

### Author: ![503646](https://avatars.discourse-cdn.com/v4/letter/5/e19adc/32.png) [@503646](https://forum.code.org/u/503646)
#### Post date: [December 22, 2021, 2:18pm UTC](https://forum.code.org/t/unit-3-lesson-27-debug-help/35566/6 "2021-12-22T14:18:55Z")

</div>

[https://support.code.org/](https://support.code.org/)
