Skip to content

Input.get_last_mouse_screen_velocity returns offset from program start (roughly), not velocity #107997

Closed
@bernhardbarker

Description

@bernhardbarker

Tested versions

Reproducible in: 4.3.stable, 4.4.stable, 4.5.beta1

System information

Godot v4.5.beta1 - Windows 11 (build 26100) - Multi-window, 1 monitor - OpenGL 3 (Compatibility) - NVIDIA GeForce RTX 3080 Laptop GPU (NVIDIA; 31.0.15.5186) - AMD Ryzen 7 5800H with Radeon Graphics (16 threads) - 15.35 GiB memory

Issue description

When calling Input.get_last_mouse_screen_velocity in _physics_process, it seems to return the difference between the current mouse position and the mouse position when the program started (roughly - when not moving the mouse, the returned value is not zero and it also jumps around). It doesn't return the velocity.

Input.get_last_mouse_velocity() works correctly.

Image

Steps to reproduce

Run the example project. Move the mouse. See that the mouse screen velocity showing in the label is wrong.

Minimal reproduction project (MRP)

project.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions