|
@@ -69,6 +69,7 @@ func _physics_process(delta):
|
|
up = global_transform.origin.normalized()
|
|
up = global_transform.origin.normalized()
|
|
right = forward.cross(up).normalized()
|
|
right = forward.cross(up).normalized()
|
|
forward = up.cross(right).normalized()
|
|
forward = up.cross(right).normalized()
|
|
|
|
+ transform.basis = Basis(right, up, -forward)
|
|
|
|
|
|
if can_move and (is_on_floor() or allow_fall_input):
|
|
if can_move and (is_on_floor() or allow_fall_input):
|
|
|
|
|
|
@@ -108,10 +109,10 @@ func _physics_process(delta):
|
|
|
|
|
|
velocity = velocity.linear_interpolate(dir * (move_speed_sprint if move_sprint else move_speed), move_acceleration * delta)
|
|
velocity = velocity.linear_interpolate(dir * (move_speed_sprint if move_sprint else move_speed), move_acceleration * delta)
|
|
if !is_on_floor():
|
|
if !is_on_floor():
|
|
- velocity += -up * gravaty * delta
|
|
|
|
|
|
+ velocity -= up * gravaty
|
|
velocity = move_and_slide(velocity, up)
|
|
velocity = move_and_slide(velocity, up)
|
|
|
|
|
|
- transform = transform.looking_at(transform.origin + forward, up)
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
#Smooth movement
|
|
#Smooth movement
|