Recoil system

This commit is contained in:
Rendo 2025-11-26 18:53:39 +05:00
commit cdfce4c7db
11 changed files with 144 additions and 8 deletions

View file

@ -64,7 +64,7 @@ func _physics_process(delta: float) -> void:
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var input_dir := Input.get_vector("plr_strafe_l", "plr_strafe_r", "plr_forward", "plr_back")
var input_dir := Input.get_vector("plr_strafe_r","plr_strafe_l", "plr_back","plr_forward")
var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction:
velocity.x = direction.x * SPEED