Skip to content

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

Open
@furrykef

Description

@furrykef

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions