FIXED BULLETHOLE GLITCH
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
extends CharacterBody3D
|
||||
|
||||
const MAX_AIR_DASH = 1
|
||||
|
||||
var speed
|
||||
var double_jump = true
|
||||
var air_dash = MAX_AIR_DASH
|
||||
var gravity = 9.8
|
||||
var is_climbing = false
|
||||
var ladder_center
|
||||
@@ -125,6 +127,7 @@ func _physics_process(delta):
|
||||
velocity.y -= gravity * delta
|
||||
else:
|
||||
double_jump = true
|
||||
air_dash = MAX_AIR_DASH
|
||||
|
||||
# Handle jump.
|
||||
if Input.is_action_just_pressed("jump") and is_on_floor() and !is_climbing:
|
||||
@@ -140,10 +143,11 @@ func _physics_process(delta):
|
||||
var direction = (self.transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
|
||||
# Handle Sprint
|
||||
if Input.is_action_just_pressed("sprint") and !is_on_floor():
|
||||
if remaining_stamina >= DASH_STAM_REQ:
|
||||
if air_dash > 0:
|
||||
velocity.x += direction.x * DASH_SPEED
|
||||
velocity.z += direction.z * DASH_SPEED
|
||||
remaining_stamina -= 180
|
||||
air_dash -= 1
|
||||
print("AIR DASH " +str(air_dash))
|
||||
|
||||
if is_on_floor() and !is_climbing:
|
||||
if direction:
|
||||
|
||||
Reference in New Issue
Block a user