# Jittery movements

**URL:** <https://forum.makecode.com/t/jittery-movements/32353>\
**Category:** Help\
**Tags:** game\
**Created:** [December 9, 2024, 7:18pm UTC](https://forum.makecode.com/t/jittery-movements/32353 "2024-12-09T19:18:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sonicblaston](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sonicblaston/32/19164_2.png) [@Sonicblaston](https://forum.makecode.com/u/Sonicblaston)\
**Post date:** [December 9, 2024, 7:18pm UTC](https://forum.makecode.com/t/jittery-movements/32353/1 "2024-12-09T19:18:54Z")

</div>

Hey, I’m working on a game and trying to implement hitboxes. However, the movement looks really jittery when I move. I’m using separate sprites for the character and the hitbox. I’m not sure what’s causing this, since I don’t think it has to do with the hitbox itself. Even when I remove the character sprite completely, it still looks bad. Does anyone know what might be causing this?

Here’s the link:

> **[jittery movements](https://arcade.makecode.com/S54457-55509-15230-05719)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

btw i have no idea what happened to the preview GIF lol.

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [December 9, 2024, 11:46pm UTC](https://forum.makecode.com/t/jittery-movements/32353/2 "2024-12-09T23:46:41Z")

</div>

> [@Sonicblaston](#):
>
> btw i have no idea what happened to the preview GIF lol.

looks abolutely sick  
To fix the jitter

 ![image](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex020/uploads/makecode/original/3X/0/7/07ab69f243052f2078bf4d6039ab2cda506f6224.png)  
use forever block instead, it seems to fix the jitter (i think because game update is slower?)

---

<div class="post-metadata">

**Author:** ![AgentBoom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agentboom/32/16635_2.png) [@AgentBoom](https://forum.makecode.com/u/AgentBoom)\
**Post date:** [December 9, 2024, 11:46pm UTC](https://forum.makecode.com/t/jittery-movements/32353/3 "2024-12-09T23:46:45Z")

</div>

I’ve seen this before… It’s weird. In my experience, it happens in some of the projects I make. I make a new one and it’s fixed. I dunno, there’s probably a way around it.

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [December 9, 2024, 11:46pm UTC](https://forum.makecode.com/t/jittery-movements/32353/4 "2024-12-09T23:46:48Z")

</div>

If I remember correctly, there is a weird camera bug that does this with sprites of specific sizes. If you try changing the size of the sprite, does it help? (You might have to make the sprite bigger or smaller to change the hitbox)

---

<div class="post-metadata">

**Author:** ![Jedi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedi/32/14307_2.png) [@Jedi](https://forum.makecode.com/u/Jedi)\
**Post date:** [December 9, 2024, 11:46pm UTC](https://forum.makecode.com/t/jittery-movements/32353/5 "2024-12-09T23:46:50Z")

</div>

i think its because your player’s width is an odd number

---

<div class="post-metadata">

**Author:** ![Sonicblaston](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sonicblaston/32/19164_2.png) [@Sonicblaston](https://forum.makecode.com/u/Sonicblaston)\
**Post date:** [December 10, 2024, 4:06pm UTC](https://forum.makecode.com/t/jittery-movements/32353/6 "2024-12-10T16:06:41Z")

</div>

Just to answer everybody. The sprite size was indeed the problem. I didn`t actually know that an odd number of pixels would make this happen. And to answer Luke. No it isn’t really better to ise a forever loop in this scenario. It is actually slower. If you turn off the invisibility on the hitbox and change to a forever loop, you can see that the character is lagging behind. Thanks for the help guys!

---

<div class="post-metadata">

**Author:** ![Jedi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedi/32/14307_2.png) [@Jedi](https://forum.makecode.com/u/Jedi)\
**Post date:** [December 16, 2024, 2:29am UTC](https://forum.makecode.com/t/jittery-movements/32353/7 "2024-12-16T02:29:18Z")

</div>

i think the reason why an odd number makes it jittery is because makecode uses a centered coordinate system instead of a top-left coordinate system so when a sprite image has an odd number width or height it has to round its position to the nearest number and sometimes it does that 1 pixel more, and sometimes it does that 1 pixel less, thus causing that jittery problem.
