more collision tweaks and fixed gun folding
This commit is contained in:
@@ -63,6 +63,8 @@ despawning = true
|
|||||||
despawn_time_s = 20
|
despawn_time_s = 20
|
||||||
|
|
||||||
[node name="Area3D" type="Area3D" parent="."]
|
[node name="Area3D" type="Area3D" parent="."]
|
||||||
|
collision_layer = 16
|
||||||
|
collision_mask = 16
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
||||||
shape = SubResource("CapsuleShape3D_om0ey")
|
shape = SubResource("CapsuleShape3D_om0ey")
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ height = 0.07
|
|||||||
radius = 0.025
|
radius = 0.025
|
||||||
|
|
||||||
[node name="casing_2" type="RigidBody3D" groups=["spawned"]]
|
[node name="casing_2" type="RigidBody3D" groups=["spawned"]]
|
||||||
collision_layer = 2
|
collision_layer = 0
|
||||||
collision_mask = 7
|
collision_mask = 5
|
||||||
mass = 0.1
|
mass = 0.1
|
||||||
continuous_cd = true
|
continuous_cd = true
|
||||||
contact_monitor = true
|
contact_monitor = true
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ mesh = SubResource("ArrayMesh_howqw")
|
|||||||
skeleton = NodePath("")
|
skeleton = NodePath("")
|
||||||
|
|
||||||
[node name="Area3D" type="Area3D" parent="."]
|
[node name="Area3D" type="Area3D" parent="."]
|
||||||
|
collision_layer = 16
|
||||||
|
collision_mask = 16
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
||||||
shape = SubResource("CapsuleShape3D_om0ey")
|
shape = SubResource("CapsuleShape3D_om0ey")
|
||||||
|
|||||||
@@ -118,6 +118,8 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00280762, 0.0277557, 0)
|
|||||||
shape = SubResource("BoxShape3D_dcoqt")
|
shape = SubResource("BoxShape3D_dcoqt")
|
||||||
|
|
||||||
[node name="Area3D" type="Area3D" parent="."]
|
[node name="Area3D" type="Area3D" parent="."]
|
||||||
|
collision_layer = 16
|
||||||
|
collision_mask = 16
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
||||||
shape = SubResource("CapsuleShape3D_ms2qn")
|
shape = SubResource("CapsuleShape3D_ms2qn")
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -36,7 +36,8 @@ radius = 8.0
|
|||||||
|
|
||||||
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("weapon_holder") groups=["player"]]
|
[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)
|
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
|
safe_margin = 0.5
|
||||||
script = ExtResource("1_x7wms")
|
script = ExtResource("1_x7wms")
|
||||||
dead_player = ExtResource("2_4hoys")
|
dead_player = ExtResource("2_4hoys")
|
||||||
@@ -96,6 +97,7 @@ padding_amount = 0.025
|
|||||||
[node name="GunRay" type="RayCast3D" parent="Head/Camera3D" groups=["gun_ray"]]
|
[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)
|
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)
|
target_position = Vector3(0, 0, -1.2)
|
||||||
|
hit_back_faces = false
|
||||||
|
|
||||||
[node name="AudioListener3D" type="AudioListener3D" parent="Head/Camera3D"]
|
[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)
|
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
@@ -60,6 +60,8 @@ despawn_time_s = 20
|
|||||||
pickupType = 1
|
pickupType = 1
|
||||||
|
|
||||||
[node name="Area3D" type="Area3D" parent="."]
|
[node name="Area3D" type="Area3D" parent="."]
|
||||||
|
collision_layer = 16
|
||||||
|
collision_mask = 16
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
||||||
shape = SubResource("CapsuleShape3D_om0ey")
|
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
@@ -96,7 +96,7 @@ func shoot(delta):
|
|||||||
if player.gun_folded == false:
|
if player.gun_folded == false:
|
||||||
instance_bullet.transform.basis = player.bullet_ray.global_transform.basis
|
instance_bullet.transform.basis = player.bullet_ray.global_transform.basis
|
||||||
else:
|
else:
|
||||||
instance_bullet.transform.basis = barrel_raycast.global_transform.basis
|
instance_bullet.transform.basis = barrel_raycast.global_transform.basis
|
||||||
instance_bullet.bullet_speed = bullet_speed
|
instance_bullet.bullet_speed = bullet_speed
|
||||||
instance_bullet.player_velocity = player.velocity
|
instance_bullet.player_velocity = player.velocity
|
||||||
instance_bullet.bullet_drop = bullet_drop
|
instance_bullet.bullet_drop = bullet_drop
|
||||||
|
|||||||
@@ -234,8 +234,7 @@ func _physics_process(delta):
|
|||||||
gun.cycle_count = gun.cycle_count_start
|
gun.cycle_count = gun.cycle_count_start
|
||||||
|
|
||||||
# Gun folding out of the way
|
# Gun folding out of the way
|
||||||
if gun_ray.is_colliding() and !gun_ray.get_collider().is_in_group("player"):
|
if gun_ray.is_colliding():
|
||||||
#check distance to wall later ?
|
|
||||||
gun.rotation = lerp(gun.rotation, Vector3(1, -1, -.25), delta * 10)
|
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.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
|
gun_folded = true
|
||||||
|
|||||||
Reference in New Issue
Block a user