question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to eliminate jitter when attempting to move outside of clamp

See original GitHub issue

When attempting to move outside of clamp bounds, the entire world jitters horribly. The world essentially seizures until the deceleration brings it back to the clamping bounds.

My plugins are as follows:

new Viewport({
  // ... required screen and world width/heights
})
  .clamp({ direction: 'all', underflow: 'center' })
  .drag()
  .pinch()
  .decelerate()

I’ve tried using bounce options, different frictions, etc. but nothing seems to make the move just stop when hitting the clamp bounds.

My ideal behavior would be that if a move is attempted that would bring the view outside of the clamp bounds, it would just not perform that move. Any tips on how to implement this?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
EikeLuederscommented, Oct 26, 2021

It works when you call .clamp() after setting the drag options. Vice versa you get this jittering if dragging outside the world bounds.

viewport.drag().clamp({
    direction: 'all'
})
1reaction
Redmegacommented, Dec 17, 2019

We actually ended up pushing the clamp() ticker solution to prod, so I can’t just point you at our site anymore. I’ll try and make a reproduction on codesandbox soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to smooth damp towards a moving target without causing ...
How to smooth damp towards a moving target without causing jitter in the movement · 1) Do it in FixedUpdate instead · 2)...
Read more >
How to remove Camera Movement Jitter - Questions - Babylon.js
Hey guys… I cam moving a FreeCamera around my scene using a Lerp and directly setting the Position but i get some camera...
Read more >
How do I. Avoid jitters in a retro project - Game Building Help
As the camera "settles" on the player when you stop moving, it will jitter 1px to the right, then 1px to the left,...
Read more >
Fixing jitter and stutter - Godot Docs
To avoid this, starting with 3.1, Godot raises the game priority to "Above Normal". This helps considerably but may not completely eliminate stutter....
Read more >
How To Fix Jittering Details and Improve Your Video Quality
Jitteting of Details ( JItter ) along with digital noise can make your footage unusable. It can remind you of some sort of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found