From 6e6cbb95e3e573a34a4243519fec401a81070362 Mon Sep 17 00:00:00 2001 From: Derek Date: Wed, 19 Feb 2025 08:42:11 -0600 Subject: [PATCH] wall running tweaks --- scenes/enemy_working_scene.tscn | 18 ++++++++++++++++++ scripts/player.gd | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/scenes/enemy_working_scene.tscn b/scenes/enemy_working_scene.tscn index 951ecbb..c8f642d 100644 --- a/scenes/enemy_working_scene.tscn +++ b/scenes/enemy_working_scene.tscn @@ -197,6 +197,24 @@ use_collision = true size = Vector3(9.97656, 21.4505, 9.16638) material = ExtResource("7_l3crk") +[node name="CSGBox3D34" type="CSGBox3D" parent="NavigationRegion3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.07182, 9.43937, -12.2423) +use_collision = true +size = Vector3(9.97656, 21.4505, 9.16638) +material = ExtResource("7_l3crk") + +[node name="CSGBox3D35" type="CSGBox3D" parent="NavigationRegion3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.600389, 11.8059, -10.6879) +use_collision = true +size = Vector3(61.0098, 8.70052, 1.6647) +material = ExtResource("7_l3crk") + +[node name="CSGBox3D36" type="CSGBox3D" parent="NavigationRegion3D"] +transform = Transform3D(0.914452, 0, -0.404695, 0, 1, 0, 0.404695, 0, 0.914452, -16.2148, 7.74282, 27.2205) +use_collision = true +size = Vector3(61.0098, 8.70052, 1.6647) +material = ExtResource("7_l3crk") + [node name="CSGBox3D23" type="CSGBox3D" parent="NavigationRegion3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.69811, 9.43937, 33.5882) use_collision = true diff --git a/scripts/player.gd b/scripts/player.gd index 93fafb3..78768e1 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -306,10 +306,10 @@ func _physics_process(delta): else: velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5) velocity.z = lerp(velocity.z, direction.z * speed, delta * 6.5) - ## wall_run + ## Wall Running if wall_ray_1.is_colliding() or wall_ray_2.is_colliding(): if abs(Vector2(velocity.x,velocity.y)) >= Vector2(5.0,5.0): - velocity.y = clamp(velocity.y,-2,abs(velocity.y)) + velocity.y = clamp(velocity.y,-1,abs(velocity.y)) #velocity.x += -velocity.x * .01 * delta #velocity.z += -velocity.z * .01 * delta