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

Voxel demo doesn't scale acceleration or friction by delta #1166

Open
furrykef opened this issue Feb 16, 2025 · 1 comment
Open

Voxel demo doesn't scale acceleration or friction by delta #1166

furrykef opened this issue Feb 16, 2025 · 1 comment
Labels

Comments

@furrykef
Copy link

Which demo project is affected:
godot-demo-projects/3d/voxel

OS/device including version:
any

Issue description:
In player/player.gd, constants such as MOVEMENT_SPEED_GROUND and MOVEMENT_FRICTION_GROUND are multiplied without being scaled by delta (e.g., here). That means the amount of acceleration or friction will be dependent on the physics time step. The player character will accelerate twice as fast at 120 ticks per second than at 60, for example.

The correct way to do it is to multiply by MOVEMENT_SPEED_GROUND**delta, etc. (notice that delta is an exponent). This will require changing the constants to reflect the scaling; since the project's physics time step is currently set to 120 ticks per second, the constants would have to be multiplied by 120 to give the same behavior.

@furrykef furrykef added the bug label Feb 16, 2025
@Calinou
Copy link
Member

Calinou commented Feb 18, 2025

Feel free to open a pull request for this 🙂

See also godotengine/godot-proposals#9803.

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

No branches or pull requests

2 participants