How to stop jittering with movement script

So I’ve been trying to use this script and it works perfectly fine but the problem is that everytime my character collides with any object starts jittering, any idea how to solve this?

I would look into changing how you move the player. Instead of directly moving via the transform, I would do RigidBody.Moveposition instead (inside the FixedUpdate). If you use a transform directly, its moved after physics has done all its business… so you could potentially get weird collisions. This happens because physics is inside the fixed update… which isn’t guaranteed to be called every frame.