weapon swap working and array tracking bullet status

This commit is contained in:
derek
2024-07-15 14:11:10 -05:00
parent f2ff68b7fa
commit 53765f7ecd
8 changed files with 189 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=20 format=3 uid="uid://brl0bsqjl5dg3"]
[gd_scene load_steps=22 format=3 uid="uid://brl0bsqjl5dg3"]
[ext_resource type="PackedScene" uid="uid://c33b6ldlxxfro" path="res://assets/Models/mac10.blend" id="1_nb4p5"]
[ext_resource type="Script" path="res://scripts/gun.gd" id="2_6i1l4"]
@@ -310,17 +310,90 @@ tracks/5/keys = {
[sub_resource type="Animation" id="Animation_tikvk"]
resource_name = "sprint"
[sub_resource type="Animation" id="Animation_i5303"]
resource_name = "swap_out"
step = 0.01
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("mac10:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.25, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(-0.270935, -0.0610588, 0), Vector3(1.24557, 1.01031, 2.22439)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("mac10:rotation")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.25, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(0, -1.5708, 0), Vector3(-0.0758979, -1.23084, 0.21119), Vector3(-0.0713455, -1.36426, -2.36786)]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(1),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"swapped_out"
}]
}
[sub_resource type="Animation" id="Animation_0sp0s"]
resource_name = "swap_in"
step = 0.01
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("mac10:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.6, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(1.24557, 1.01031, 2.22439), Vector3(-0.270935, -0.0610588, 0), Vector3(0, 0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("mac10:rotation")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.6, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(-0.0713455, -1.36426, -2.36786), Vector3(-0.0758979, -1.23084, 0.21119), Vector3(0, -1.5708, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_vkrtt"]
_data = {
"empty": SubResource("Animation_u008m"),
"inspect": SubResource("Animation_cifop"),
"reload": SubResource("Animation_svhrs"),
"shoot": SubResource("Animation_bsc1a"),
"sprint": SubResource("Animation_tikvk")
"sprint": SubResource("Animation_tikvk"),
"swap_in": SubResource("Animation_0sp0s"),
"swap_out": SubResource("Animation_i5303")
}
[node name="mac10" node_paths=PackedStringArray("flare_light", "anim_player", "barrel_raycast", "casing_ejector", "mag_ejector", "audio_fire", "audio_empty", "audio_reload") instance=ExtResource("1_nb4p5")]
script = ExtResource("2_6i1l4")
gun_name = "Mac 10"
max_ammo = 30
random_spread_amt = 1.5
fire_pitch_scale_amt = 0.1
@@ -338,7 +411,7 @@ audio_empty = NodePath("Audio/Empty")
audio_reload = NodePath("Audio/Reload")
[node name="mac10" parent="." index="0"]
transform = Transform3D(-1.92883e-06, 0, -0.532829, 0, 0.532828, 0, 0.532828, 0, -1.92884e-06, 0, 0, 0)
transform = Transform3D(0.00110078, 0.000233951, -0.532828, 0.00152579, 0.532826, 0.000237103, 0.532825, -0.00152628, 0.00110011, -0.00253865, -0.0010342, -0.00140877)
[node name="SpotLight3D" type="SpotLight3D" parent="mac10" index="0"]
transform = Transform3D(-6.79394e-06, 0, 1.87678, 0, 1.87678, 0, -1.87677, 0, -6.79392e-06, -1.63231, 0, 5.90892e-06)
@@ -377,7 +450,7 @@ transform = Transform3D(-0.00171201, 5.61171e-05, 1.87678, 0.567942, 1.78878, 0.
target_position = Vector3(1, 0, 0)
[node name="Trigger" parent="mac10" index="7"]
transform = Transform3D(0.962182, -0.272406, 6.11661e-07, 0.272406, 0.962182, -1.62236e-06, -1.4659e-07, 1.72762e-06, 1, -0.13807, -0.230628, 0.00528617)
transform = Transform3D(0.978226, 0.207541, 0, -0.207541, 0.978226, 0, 0, 0, 1, -0.13807, -0.230628, 0.00528617)
[node name="GunAnims" type="AnimationPlayer" parent="." index="1"]
libraries = {