The problem is the way you are adding the gravity.

sp.y += 4

with this code you are adding 4 points of gravity every frame

If your PC runs at 30 fps you will be adding 4 * 30 gravity points
but if your PC runs at 60 fps you will be adding 4 * 60 gravity points
That makes your gravity inconcistent.

You should be adding gravity multiplied by delta.

sp.y += 4 * delta

Note that 4 points it will be to slow since now you are adding 4 points of gravity per second and not per frame

multiplied by delta but the problem is still there.
basically if i collide to that left block then the player will always fall for some reason.
and if i do not collide to it and just go right, then i will not fall.

darlock | 2020-02-29 05:13

I was seeing your code, there is not need to multiply 7 and 9 lines by delta:

sp.x = -3600 * delta

since you are setting it to 3600 and move_and_slide already multiply your linear_velocity (or sp) by delta (its a constant force).

However you need to multiply your gravity addition by delta (u already did it in your code) because you are ADDING a force to your linear_velocity (sp). You need to make your addition constant.

About the main problem I honestly dont know what could be happening