reduce stutters related with physics interpolation

Godot Version

4.5

Question

Stutters when crouching or sliding

If you are editing the collision shape’s size that can result in funky physics, if you are doing that maybe using different CollisionShapes nodes and disable/enabling the relevant one would help, but it’s hard to say as you haven’t given much information. What have you tried? Why did it fail?

1 Like

i can’t believe the answer was right in front of me , quite stupid of me , like you said the solution ws the collider i switched it from a cylinder to a capsule to implement my sliding code thinking it would be better with a capsule because most tutorials use that, but the code I was modifying used a cylinder originally. I’m new to this so i’m guessing collider shapes affect how physics works? , but thank you i switched the collider back to a cylinder and it fixed it. Also, do you recommend putting movement code in the _process or _physicsprocess and what benefits do they have on performance , like i said i’m new sorry for the questions

place movement code in _physics_process as it’s the only place it will work. Collisions should take place in _physics_process, it operates in a special state.

_process will run once per frame, it’s delta may fluctuate but some effort is made on the engine’s part to keep delta steady. One step using position += direction * delta may be a large distance on some frames and short on others, _physics_process will rarely change delta, so the steps cover the same distance, but _physics_process may run more than once per frame to make up the distance.

1 Like