Skip to content
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

Godot 3.2.3 move_and_slide_with_snap() doesn't function correctly at 144fps. #43368

Open
Tracked by #45334 ...
Aca-Pris opened this issue Nov 6, 2020 · 5 comments
Open
Tracked by #45334 ...

Comments

@Aca-Pris
Copy link

Aca-Pris commented Nov 6, 2020

Godot version:

v3.2.3

OS/device including version:

GTX 980ti, Windows 10 64 bit

Issue description:

Godot 3.2.3 move_and_slide_with_snap() doesn't function as intended with moving platforms at 144hz/fps. The player will slowly slide off moving platforms when at 144fps. The function works as intended at 60fps.

Steps to reproduce:
Stand on the blue moving platform in the included project with a 144fps hz display.

Minimal reproduction project:

Stand on the platform in this project with a 144fps display.
First Person Starter.zip

@Calinou
Copy link
Member

Calinou commented Nov 6, 2020

You should run physics functions in _physics_process(), not _process(). This is because different physics update rates will never behave exactly like each other.

To avoid stuttering at higher refresh rates when using a fixed timestep (which is what _physics_process() uses), use the smoothing-addon to implement physics interpolation in your project.

@Aca-Pris
Copy link
Author

Aca-Pris commented Nov 7, 2020

The current code within _process() (which only becomes active upon player input) is irrelevant when it comes to the reproduction of the unintended behaviour which happens independently of player input.

The physics functions are in _physics_process()
The walk() function (where move_and_slide_with_snap() is called) is called within _physics_process()

I will implement the smoothing-addon. However. The unintended behaviour is more than frame stuttering. The player will fall off the platform.

@Aca-Pris
Copy link
Author

Aca-Pris commented Nov 8, 2020

I implemented the smoothing addon as suggested to both the MovingPlatform and Player objects.
The problem still persists in the same way as it did previously at 144hz.

I locked the project FPS to 60, and the project does function as intended at this FPS.
However, the project is still non-functional at 144hz.

MovingPlatform.zip

@e344fde6bf
Copy link
Contributor

The moving platform is using an AnimationPlayer to control its movement. Since it's a physics object, you need to set the ProcessMode to Physics in the animation player so it only updates during the physics tick. In the example project, it is set to Idle which means it is updating based on the monitor refresh rate causing the weird behaviour.

@pouleyKetchoupp
Copy link
Contributor

@rainystudio Does setting the ProcessMode of the AnimationPlayer to Physics solve your issue? I don't have a 144hz display to confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants