bullets working better and detect collision better

still need to register hits with enemy targets and find contact point to leave bullet holes
This commit is contained in:
derek
2024-10-22 15:27:33 -05:00
parent 2e7f253609
commit b70fd94184
7 changed files with 256 additions and 58 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=4 uid="uid://dqhltdnqyg8ni"]
[gd_scene load_steps=12 format=4 uid="uid://dqhltdnqyg8ni"]
[ext_resource type="Script" path="res://scripts/bullet.gd" id="1_oj0f5"]
[ext_resource type="Texture2D" uid="uid://dqytegxsmb5kg" path="res://assets/Models/bullet.transparency.png" id="2_0ks2n"]
@@ -72,25 +72,24 @@ emission_enabled = true
emission = Color(0.737886, 0.150238, 0.0835467, 1)
emission_energy_multiplier = 8.0
[node name="Bullet" type="Node3D"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_tqvit"]
height = 1.53305
radius = 0.055
[node name="Bullet" type="RigidBody3D"]
collision_layer = 0
collision_mask = 105
continuous_cd = true
contact_monitor = true
max_contacts_reported = 1
script = ExtResource("1_oj0f5")
[node name="gunbullet1" type="Node3D" parent="."]
transform = Transform3D(-2, 0, -3.01992e-07, 0, 2, 0, 3.01992e-07, 0, -2, 0, 0, 0)
[node name="Cylinder" type="MeshInstance3D" parent="gunbullet1"]
transform = Transform3D(1, 0, 0, 0, 0, -1, 0, 1, 0, -2.57922e-08, 0, -0.313849)
[node name="Cylinder" type="MeshInstance3D" parent="."]
transform = Transform3D(-2, -3.01992e-07, 0, 0, 0, -2, 3.01992e-07, -2, 0, 1.46364e-07, 0, 0.627698)
cast_shadow = 0
mesh = SubResource("ArrayMesh_gi7r4")
skeleton = NodePath("")
[node name="RayCast3D" type="RayCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1.70846, 0.000340699, 0.0133128, 0.723808)
target_position = Vector3(0, 0, -2.5)
collision_mask = 105
hit_from_inside = true
collide_with_areas = true
[node name="GPUParticles3D" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.718767)
material_override = SubResource("StandardMaterial3D_x6v7s")
@@ -111,12 +110,16 @@ explosiveness = 1.0
process_material = SubResource("ParticleProcessMaterial_3wvag")
draw_pass_1 = SubResource("BoxMesh_jrtee")
[node name="Timer" type="Timer" parent="."]
wait_time = 10.0
one_shot = true
autostart = true
[node name="Audio" type="Node" parent="."]
[node name="HitIndicator" type="AudioStreamPlayer" parent="Audio"]
stream = ExtResource("3_6j0l2")
[node name="BulletCollision" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
shape = SubResource("CylinderShape3D_tqvit")
[node name="RayCast3D" type="RayCast3D" parent="."]
target_position = Vector3(0, 0, -1)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]