# Falling sprite animation conflicting with gravity effect

**URL:** <https://forum.makecode.com/t/falling-sprite-animation-conflicting-with-gravity-effect/13174>\
**Category:** Help\
**Created:** [April 19, 2022, 5:45pm UTC](https://forum.makecode.com/t/falling-sprite-animation-conflicting-with-gravity-effect/13174 "2022-04-19T17:45:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DawnofImagination](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@DawnofImagination](https://forum.makecode.com/u/DawnofImagination)\
**Post date:** [April 19, 2022, 5:45pm UTC](https://forum.makecode.com/t/falling-sprite-animation-conflicting-with-gravity-effect/13174/1 "2022-04-19T17:45:47Z")

</div>

Hello I am new to the forum.  
I am following the “How to Make a Platformer Game [Part 2: Animations, AI, collision & spawning]” tutorial [https://www.youtube.com/watch?v=8DhGcCPfOU4](https://www.youtube.com/watch?v=8DhGcCPfOU4)  
I am near the end of this tutorial and when my cat is standing or walking (i.e., neither falling down nor jumping up), the image continuously changes between falling cat and no change in y-axis cat.  
I figured out that the gravity effect set mySprite ay (acceleration y) to 350 is conflicting with the command  
if mySprite vy (velocity y) \> 0  
set mySprite image to []  
whenever the sprite is not jumping up and not falling down  
If I get rid of gravity, the cat animation work fine.  
QUESTION: How can I fix this problem while keeping the gravity effect?  
Here is the link to my game: [https://makecode.com/\_WhuYCx5AkEuw](https://makecode.com/_WhuYCx5AkEuw)  
TIA for your help!

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 25, 2022, 5:04pm UTC](https://forum.makecode.com/t/falling-sprite-animation-conflicting-with-gravity-effect/13174/2 "2022-04-25T17:04:51Z")

</div>

Hi @DawnofImagination !  
Try just edit the image from:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/bdae13d44aedb4e4111c2638e77a78864ca5a6b0.png)  
to:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/5/5094862a10aadf29383bde2fd79c4be2c6f93283.png)  
by selecting the marquee tool (or key M for shorcut) in sprite editor, ctrl+A, and grag whole image down to the bottom.

Why it can fix?  
The prev image bottom is empty, after you set it to sprite, only solid partition considered by the phisical engine, so it is floating at that time. As the skippy.ay\>0, it will begin dropping down.

Hope this helped.

---

<div class="post-metadata">

**Author:** ![DawnofImagination](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@DawnofImagination](https://forum.makecode.com/u/DawnofImagination)\
**Post date:** [April 25, 2022, 6:41pm UTC](https://forum.makecode.com/t/falling-sprite-animation-conflicting-with-gravity-effect/13174/3 "2022-04-25T18:41:38Z")

</div>

Hello AqeeAqee,

Thank you so much. I did not realize that one of my sprite drawings left the cat hanging. Your fix worked perfectly!

Have a great day.
