-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2D platform physics collision jitter #45259
Comments
@rick551 Can you reproduce this in 3.2.4beta5? |
Confirmed regression from #42574. |
Apologies for late reply, the issue was not in 3.2.4beta5. |
These changes revert the part of godotengine#42576 that was skipping rest info checking when no collision occurred in the motion check. That allows to make floor detection consistent by checking for rest info even if there was no collision during the motion (godotengine#45259). On the other hand, one-way collision need another fix in order to avoid inconsistencies between motion check and rest info check that causes bugs like godotengine#25967. This is done by restoring valid_depth in rest info check and set it the same way as in motion check. Also making minor changes in _rest_cbk_result in order to early exit by doing depth tests first, before extra calculations for normal checking. Fixes godotengine#45259
@rick551a Could you check that everything works ok again if you set a safe margin of 0.01 on the KinematicBody2D? When working with pixel art / low screen resolution, the scale you use for motion is lower (including gravity), so a lower safe margin is needed for collision algorithms to work properly. There used to be a workaround in |
Hello, just tested the heartbeast example (linked above) with 3.2.4 rc1. Ok, here is the report: with physics_fps=60 and safe margin=0.01 works fine If you test this example, it is important to diagonally jump and move around to really see the issues. |
Just uploaded a video to show the jitter after landing with physics_fps=144 & safe_margin=0.01 (video quality is bad, just 30fps but you get the idea) |
After some testing, i now see that with physics_fps=144 & safe_margin=0.005, it works as intended. |
@rick551a Thanks for testing all these cases! It makes sense to set the safe margin depending on the physics fps, because at higher fps the distances in each step will be reduced and again the algorithm is not adaptive. Note for the physics team: |
Unless the fix would be very fast (as in the next version, 3.2.4 which I understand is already at RC), docs should be updated to mention the relationship between (increased) fps and safe margin. |
Godot version: 3.2.4 beta6 (mono)
OS/device including version: Win10 Nvidia 1650
Issue description:
Tested a simple 2d platformer, the player is unable to jump and continually jitters up and down, almost through the ground.
Worked fine in 3.2.3 (stable) mono.
Steps to reproduce:
Open project, run, move left right, try to jump.
Minimal reproduction project:
This simple project by heartbeast:
https://github.com/uheartbeast/simple--heart-platformer
The text was updated successfully, but these errors were encountered: