# Camera damping in platformer

**URL:** <https://forum.makecode.com/t/camera-damping-in-platformer/39276>\
**Category:** Help\
**Tags:** game\
**Created:** [September 15, 2025, 4:25pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276 "2025-09-15T16:25:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [September 15, 2025, 4:25pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276/1 "2025-09-15T16:25:48Z")

</div>

I’m trying to make a game that looks and feels really polished, and I want to know if there is a way to add camera damping. @richard do you have any tips on this?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [September 15, 2025, 4:52pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276/2 "2025-09-15T16:52:03Z")

</div>

can you be more specific about what behavior you’re looking for? maybe give me an example of a game where the camera works like you want?

---

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [September 15, 2025, 5:31pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276/3 "2025-09-15T17:31:05Z")

</div>

Basically, a camera with delay. The character will move, and the camera follows slightly later, offsetting the character until you stop moving, when the camera then catches up to the player.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [September 15, 2025, 5:55pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276/4 "2025-09-15T17:55:56Z")

</div>

@not_a_lemon give this a shot:

> **[camera-delay](https://arcade.makecode.com/56942-97314-75894-25797)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

it uses @jwunderl’s arcade-sprite-util extension. you can make the camera following slower/faster by changing the 0.96 value. lower values are faster, higher values are slower. make sure you never set it to be 1 or above because that’s when the camera will start moving away from the player (e.g. if you want it slower, try a value like `0.999`)

---

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [September 15, 2025, 6:56pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276/5 "2025-09-15T18:56:25Z")

</div>

TYSM! this is exactly what I need!

---

<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:** [September 15, 2025, 7:29pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276/6 "2025-09-15T19:29:12Z")

</div>

a simple way to do it is to set the distance from cam to player as the follow speed. This means that when the camera sprite if 100px away it will move at 100 speed. This creates a simple linear graph. As it gets closer it will slow down and as it gets far away it speeds up: (80px = 80 speed, 50px = 50 speed, 5px = 5 speed)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/1/515e5bb289f44af4b98c05b3a857cb960c56bbdf.png)

However this far too slow when close, so it’s helpful to add a base movement speed of to the distance variable. Here I’ve added 50. (notice how y value of the graph shifts up 50 since i’ve added it to all possible distances)  
(80px = 130 speed, 50px = 100 speed, 5px = 55 speed)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/d/5d83b0238de38a4f17e4804f8087ec552d981803.png)

Another function you can do is just multiply the distance by a constant and then add. Here it’s 2. This increases the steepness of the curve, making the camera follow faster. This also preserves its easing.  
(80px = 210 speed, 50px = 100 speed, 5px = 60 speed)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/4/7/47d400fd4ba790c423f67ea999378aad3a6df462.png)

It’s cool to define in maths terms since you can apply simple graphs to it too:  
Let y = speed  
Let x = distance  
The 3 equations are:

- Simple easing: y = x
- Simple easing + base speed: y = x + 50
- Variable easing + base speed: y = 2x + 50

Final equation is y = ax + c  
where a = rate of speed increase (gradient)  
where c = speed at 0 distance (y intercept)

---

<div class="post-metadata">

**Author:** ![TheEarth](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/theearth/32/34579_2.png) [@TheEarth](https://forum.makecode.com/u/TheEarth)\
**Post date:** [September 15, 2025, 11:13pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276/7 "2025-09-15T23:13:25Z")

</div>

I swear this basically hieroglyphic

---

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [September 16, 2025, 10:59pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276/8 "2025-09-16T22:59:09Z")

</div>

@richard is it all right if I turn this into an extension?

---

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [September 16, 2025, 11:34pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276/9 "2025-09-16T23:34:58Z")

</div>

This is exactly why I come to the forums with problems like this, so that I can find ways to fix the problem, but also get info on why it works! thanks!

---

<div class="post-metadata">

**Author:** ![a012](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/a012/32/24099_2.png) [@a012](https://forum.makecode.com/u/a012)\
**Post date:** [September 16, 2025, 11:39pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276/10 "2025-09-16T23:39:29Z")

</div>

I know I am not Richard, but I do think it is a good idea turn this as an extension because I did make an extension similar like this, so I do agree you try making this as an extension

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [September 17, 2025, 5:24pm UTC](https://forum.makecode.com/t/camera-damping-in-platformer/39276/11 "2025-09-17T17:24:14Z")

</div>

@not_a_lemon you are free to use the code however you want!
