more collision tweaks and fixed gun folding

This commit is contained in:
derek
2024-09-26 16:37:54 -05:00
parent 79600825f5
commit 2d49d4e31f
12 changed files with 227 additions and 207 deletions

View File

@@ -63,6 +63,8 @@ despawning = true
despawn_time_s = 20
[node name="Area3D" type="Area3D" parent="."]
collision_layer = 16
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
shape = SubResource("CapsuleShape3D_om0ey")

View File

@@ -10,8 +10,8 @@ height = 0.07
radius = 0.025
[node name="casing_2" type="RigidBody3D" groups=["spawned"]]
collision_layer = 2
collision_mask = 7
collision_layer = 0
collision_mask = 5
mass = 0.1
continuous_cd = true
contact_monitor = true

View File

@@ -59,6 +59,8 @@ mesh = SubResource("ArrayMesh_howqw")
skeleton = NodePath("")
[node name="Area3D" type="Area3D" parent="."]
collision_layer = 16
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
shape = SubResource("CapsuleShape3D_om0ey")

View File

@@ -118,6 +118,8 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00280762, 0.0277557, 0)
shape = SubResource("BoxShape3D_dcoqt")
[node name="Area3D" type="Area3D" parent="."]
collision_layer = 16
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
shape = SubResource("CapsuleShape3D_ms2qn")

File diff suppressed because one or more lines are too long

View File

@@ -36,7 +36,8 @@ radius = 8.0
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("weapon_holder") groups=["player"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.11359, 0)
collision_layer = 11
collision_layer = 126
collision_mask = 9
safe_margin = 0.5
script = ExtResource("1_x7wms")
dead_player = ExtResource("2_4hoys")
@@ -96,6 +97,7 @@ padding_amount = 0.025
[node name="GunRay" type="RayCast3D" parent="Head/Camera3D" groups=["gun_ray"]]
transform = Transform3D(0.977933, 0, -0.208919, 0, 1, 7.45058e-09, 0.208919, 0, 0.977933, 0, -0.197421, -0.129669)
target_position = Vector3(0, 0, -1.2)
hit_back_faces = false
[node name="AudioListener3D" type="AudioListener3D" parent="Head/Camera3D"]
transform = Transform3D(1, 0, 0, 0, 0.992332, 0.123601, 0, -0.123601, 0.992332, 0, -0.921646, -0.000722691)

File diff suppressed because one or more lines are too long

View File

@@ -60,6 +60,8 @@ despawn_time_s = 20
pickupType = 1
[node name="Area3D" type="Area3D" parent="."]
collision_layer = 16
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
shape = SubResource("CapsuleShape3D_om0ey")

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -234,8 +234,7 @@ func _physics_process(delta):
gun.cycle_count = gun.cycle_count_start
# Gun folding out of the way
if gun_ray.is_colliding() and !gun_ray.get_collider().is_in_group("player"):
#check distance to wall later ?
if gun_ray.is_colliding():
gun.rotation = lerp(gun.rotation, Vector3(1, -1, -.25), delta * 10)
gun.position = lerp(gun.position, Vector3(gun.start_position.x-.15,gun.start_position.y +.2,gun.start_position.z +.6),(delta*10))
gun_folded = true