Camera shaking
Open
Nobody has claimed this yet.
🎥 Camera
- Dominant language
- JavaScript
- Stars
- 40.3k
- Forks
- 7.2k
- PR merge metrics
- No merged PRs in 30d
Description
Version
- Phaser Version: 3.70 and 3.80 but probably earlier.
- Operating system:
Any (I'm on Windows) - Browser:
Any (Firefox, Chrome and Opera)
Description
- If I set the camera to exact follow the player movement 1:1, the player animation looks ok, but the background jitter.
- If I set the camera with a lerp (0.2, 0.2) to make the camera movement slower, the background works fine but the player animation jitter.
I've added more notes and uploaded a few videos in Discord: https://discord.com/channels/244245946873937922/416623653741133837/1230053213453942855
Example Test Code
The issue is visible in the current examples:
- https://labs.phaser.io/view.html?src=src%5Ccamera%5Cfollow%20user%20controlled%20sprite.js
- https://labs.phaser.io/view.html?src=src/tilemap\tests\visual%20culling%20check.js
Additional Information
The issue happens in both ways depending what the camera follows, with the background or the player.
Coming from https://github.com/phaserjs/phaser/issues/5018#issuecomment-2093802674
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior in the linked Phaser examples: camera/follow user controlled sprite.js and tilemap/tests/visual culling check.js. Compare exact-follow and lerped camera movement with the reported player and background combinations. Done means the camera-follow scenarios no longer visibly jitter for either the player or background.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100