godotengine / godotengine/godot
Rotating jitters in Input compared with physics_process with physics interpolation on
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
4.6.stable
### System information
Godot v4.6.stable - Windows 10 (build 19044) - Single-window, 1 monitor - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA; 27.21.14.6681) - AMD Ryzen 7 5800H with Radeon Graphics (16 threads) - 31.87 GiB memory
### Issue description
When performing rotation in `_input`, it's less smooth than when performed in `_physics_process` when physics interpolation is enabled.
### Steps to reproduce
In physics process, it looks mostly smooth:
```swift
var stored_mouse := Vector2.ZERO
func _unhandled_input(event):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED and event is InputEventMouseMotion:
match look_type:
look_type_e.InPhysics:
stored_mouse = event.relative
func _physics_process(delta):
if look_type == look_type_e.InPhysics:
rotate_look(stored_mouse * 0.0020 * mouse_sensitivity)
```
However in Input, it looks slightly jittery:
```swift
func _unhandled_input(event):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED and event is InputEventMouseMotion:
match look_type:
look_type_e.InInput:
rotate_look(event.relative * 0.001 * mouse_sensitivity)
```
(the 0.0020 and 0.001 difference is to approximate the different feeling between the two).
https://github.com/user-attachments/assets/018f13e1-07fa-4150-a4ca-8addd623a0e4
(hard to see with the compression)
### Minimal reproduction project (MRP)
[rotatetest.zip](https://github.com/user-attachments/files/25340575/rotatetest.zip)
Contributor guide
Assessment
This issue has not been assessed yet.