From 185de137decb12cc05c58436151456ef43ebd84e Mon Sep 17 00:00:00 2001 From: Lucas Fryzek Date: Mon, 25 Sep 2023 18:02:01 -0400 Subject: General cleanup --- prefab/player.tscn | 2 ++ prefab/tree.tscn | 1 + scripts/level_gen.gd | 3 +-- scripts/player.gd | 8 +++----- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/prefab/player.tscn b/prefab/player.tscn index d6c1432..a514664 100644 --- a/prefab/player.tscn +++ b/prefab/player.tscn @@ -24,6 +24,8 @@ shape = SubResource("BoxShape3D_ibgtc") mesh = SubResource("BoxMesh_wkmld") [node name="ThirdPersonCamera" parent="." instance=ExtResource("1_stkca")] +distance_from_pivot = 5.0 +pivot_offset = Vector2(0, 1) [node name="Picker" type="Area3D" parent="."] collision_layer = 2 diff --git a/prefab/tree.tscn b/prefab/tree.tscn index 855920d..de04de6 100644 --- a/prefab/tree.tscn +++ b/prefab/tree.tscn @@ -9,6 +9,7 @@ height = 10.0 [node name="Tree" type="Node3D"] [node name="StaticBody3D" type="StaticBody3D" parent="."] +collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5, 0) diff --git a/scripts/level_gen.gd b/scripts/level_gen.gd index 988bace..779ad01 100644 --- a/scripts/level_gen.gd +++ b/scripts/level_gen.gd @@ -155,8 +155,7 @@ func _ready(): collision_shape.set_shape(col_mesh) var static_body = StaticBody3D.new() - static_body.collision_layer = 0xb101 - static_body.collision_mask = 0xb101 + static_body.collision_layer = 0b101 static_body.add_child(collision_shape) static_body.add_child(m) diff --git a/scripts/player.gd b/scripts/player.gd index 2d4db99..7c6079b 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -94,7 +94,7 @@ func _physics_process(delta): if is_on_wall(): for col in get_slide_collision_count(): var col_obj = get_slide_collision(col) - print(col_obj.get_collider().collision_layer) + #print("Collider layer is ", col_obj.get_collider().collision_layer, " ", col_obj.get_collider()) if col_obj.get_collider().collision_layer & 0b100: valid_climb = true @@ -102,10 +102,8 @@ func _physics_process(delta): last_wall_direction = get_wall_normal() climbing = true stam_consumption += RUN_CONSUMPTION - print("Climbing now") elif climbing: climbing = false - print("Not climbing") if climbing: climb_direction_fwd = (Vector3.UP - Vector3.UP.project(last_wall_direction)).normalized() @@ -123,10 +121,10 @@ func _physics_process(delta): var direction = (input_dir.y * fwd + input_dir.x * right).normalized() var climb_direction = (input_dir.y * climb_direction_fwd + input_dir.x * climb_direction_right).normalized() if climbing: - print("Climb direction is ", climb_direction_fwd, " ", climb_direction_right, " ", get_wall_normal()) + #print("Climb direction is ", climb_direction_fwd, " ", climb_direction_right, " ", get_wall_normal()) velocity = climb_direction * speed velocity += -speed * last_wall_direction - print("Velocity is ", velocity) + #print("Velocity is ", velocity) elif direction: velocity.x = direction.x * speed velocity.z = direction.z * speed -- cgit