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

80
scenes/bullet_test.tscn Normal file
View File

@@ -0,0 +1,80 @@
[gd_scene load_steps=9 format=3 uid="uid://dq3pqbjg7o241"]
[ext_resource type="Script" path="res://scripts/LevelManager.gd" id="1_iqxey"]
[ext_resource type="PackedScene" uid="uid://brl0bsqjl5dg3" path="res://assets/mac_10.tscn" id="2_bbv4q"]
[ext_resource type="Material" uid="uid://br2pyyyl2n3cx" path="res://assets/materials/prototype/prototype1.tres" id="3_ol40x"]
[ext_resource type="PackedScene" uid="uid://drwae3loscbw7" path="res://assets/player.tscn" id="4_1k4dj"]
[ext_resource type="PackedScene" uid="uid://bmbv6ujc00jhk" path="res://assets/ammo_pickup.tscn" id="5_8hwga"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_s7a4u"]
sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
ground_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
[sub_resource type="Sky" id="Sky_c52rg"]
sky_material = SubResource("ProceduralSkyMaterial_s7a4u")
[sub_resource type="Environment" id="Environment_c1yeo"]
background_mode = 2
sky = SubResource("Sky_c52rg")
tonemap_mode = 2
ssao_enabled = true
sdfgi_enabled = true
glow_enabled = true
[node name="BulletTest" type="Node3D" node_paths=PackedStringArray("player")]
script = ExtResource("1_iqxey")
player = NodePath("Player")
gun_1 = ExtResource("2_bbv4q")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_c1yeo")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.614285, -0.683367, 0.394542, 0, 0.5, 0.866025, -0.789084, -0.531987, 0.307143, 0, 0, 0)
shadow_enabled = true
[node name="CSGBox3D2" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -20.2065, 1.06369, -8.35413)
use_collision = true
size = Vector3(9.58691, 1.80511, 9.50757)
material = ExtResource("3_ol40x")
[node name="CSGBox3D" type="CSGBox3D" parent="."]
use_collision = true
size = Vector3(50, 0.5, 50)
material = ExtResource("3_ol40x")
[node name="Player" parent="." instance=ExtResource("4_1k4dj")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.93316, 1.36359, 21.3029)
[node name="ammo_pickup" parent="." instance=ExtResource("5_8hwga")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 21.3394, 1.49663, 2.62687)
despawning = false
[node name="ammo_pickup2" parent="." instance=ExtResource("5_8hwga")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 21.7807, 1.49663, 1.89032)
despawning = false
[node name="ammo_pickup3" parent="." instance=ExtResource("5_8hwga")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 22.1793, 1.49663, 2.36679)
despawning = false
[node name="ammo_pickup4" parent="." instance=ExtResource("5_8hwga")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 22.1831, 1.49663, 3.18921)
despawning = false
[node name="ammo_pickup5" parent="." instance=ExtResource("5_8hwga")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 21.841, 1.49663, 3.64352)
despawning = false
[node name="ammo_pickup6" parent="." instance=ExtResource("5_8hwga")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 22.6368, 1.49663, 4.15159)
despawning = false
[node name="ammo_pickup7" parent="." instance=ExtResource("5_8hwga")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 21.5417, 1.49663, 4.64181)
despawning = false
[node name="ammo_pickup8" parent="." instance=ExtResource("5_8hwga")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 22.5812, 1.49663, 5.00169)
despawning = false