big
This commit is contained in:
@@ -27,6 +27,8 @@ func enter(_data: Dictionary = {}) -> void:
|
||||
machine.player.wallrun_player.play()
|
||||
|
||||
var hvel := Vector3(machine.player.velocity.x, 0.0, machine.player.velocity.z)
|
||||
if machine.player.has_method("update_wallrun_audio"):
|
||||
machine.player.update_wallrun_audio(hvel.length(), machine.wall_normal)
|
||||
_current_tangent = machine.wall_normal.cross(Vector3.UP).normalized()
|
||||
if hvel.dot(_current_tangent) < 0.0:
|
||||
_current_tangent = -_current_tangent
|
||||
@@ -71,6 +73,8 @@ func update(delta: float) -> void:
|
||||
|
||||
var hvel := Vector3(vel.x, 0.0, vel.z)
|
||||
var along := hvel.dot(wall_tangent)
|
||||
if player.has_method("update_wallrun_audio"):
|
||||
player.update_wallrun_audio(hvel.length(), machine.wall_normal)
|
||||
var target_speed: float = maxf(machine.get_effective_speed(params.wall_run_speed), along)
|
||||
along = move_toward(along, target_speed, params.wall_run_accel * delta)
|
||||
# Redirect all horizontal velocity along the wall (kills the into-wall part)
|
||||
|
||||
Reference in New Issue
Block a user