feat: changed player wall movement

This commit is contained in:
Sara Gerretsen 2026-06-24 13:14:38 +02:00
parent 86fa195acf
commit 2965ae55df

View file

@ -344,7 +344,7 @@ func _enter() -> int:
var flat_velocity := Vector2(body.velocity.x, body.velocity.z)
var input_velocity_dot : float = blackboard.get_world_move_input().normalized().dot(body.velocity.normalized())
var ground_velocity := Vector3(body.velocity.x, 0, body.velocity.z)
if body.is_on_wall_only() and input_velocity_dot > 0.01 and ground_velocity.length() >= min_ground_speed and flat_velocity.length() > -body.velocity.y * 4.0:
if body.is_on_wall_only() and input_velocity_dot > 0.3 and ground_velocity.length() >= min_ground_speed and flat_velocity.length() > -body.velocity.y * 4.0:
if Input.is_action_just_pressed(\"jump\") and run_time > min_run_time:
var wall_flat := Vector3(body.get_wall_normal().x, 0, body.get_wall_normal().z)
body.velocity = wall_flat * jump_normal_force + (ground_velocity * jump_force_ground_input_ratio + blackboard.get_world_move_input()).normalized() * jump_input_force * ground_velocity.length()
@ -524,7 +524,7 @@ character = NodePath("../PlayerModel")
[node name="DashUpgrade" type="PlayerAction" parent="PlayerBehaviourTree/BehaviourRepeater/ActionSelector" unique_id=2076145534]
script = SubResource("GDScript_exgcw")
speed = 10.0
speed = 25.0
[node name="LedgeHangSequence" type="BehaviourSequence" parent="PlayerBehaviourTree/BehaviourRepeater/ActionSelector" unique_id=285489367]
@ -549,23 +549,23 @@ process_mode = 1
[node name="WallRun" type="PlayerAction" parent="PlayerBehaviourTree/BehaviourRepeater/ActionSelector" unique_id=2090512639]
script = SubResource("GDScript_3rfka")
gravity_scale = 0.169
max_upward_velocity = 2.0
drag = 0.001
max_upward_velocity = 1.0
drag = 0.01
run_speed = 7.0
blend_in_time = 50.0
min_ground_speed = 5.0
jump_normal_force = 4.0
jump_input_force = 1.3
jump_vertical_force = 4.0
jump_normal_force = 5.0
jump_input_force = 1.5
jump_vertical_force = 5.0
min_run_time = 0.05
jump_force_ground_input_ratio = 5.0
jump_force_ground_input_ratio = 10.0
[node name="WallGrip" type="PlayerAction" parent="PlayerBehaviourTree/BehaviourRepeater/ActionSelector" unique_id=85039173]
script = SubResource("GDScript_nmc1l")
wall_drag = 15.0
max_y_velocity = 4.0
jump_normal_force = 4.0
jump_vertical_force = 6.0
jump_vertical_force = 7.0
[node name="Fall" type="PlayerAction" parent="PlayerBehaviourTree/BehaviourRepeater/ActionSelector" unique_id=570179125]
script = SubResource("GDScript_ykyjo")