weapon swap working and array tracking bullet status
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=17 format=3 uid="uid://dslxb3psx30vp"]
|
||||
[gd_scene load_steps=19 format=3 uid="uid://dslxb3psx30vp"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://svrb3n31mkag" path="res://assets/Models/gun.blend" id="1_frekg"]
|
||||
[ext_resource type="Script" path="res://scripts/gun.gd" id="2_63tea"]
|
||||
@@ -195,18 +195,89 @@ tracks/2/keys = {
|
||||
[sub_resource type="Animation" id="Animation_tikvk"]
|
||||
resource_name = "sprint"
|
||||
|
||||
[sub_resource type="Animation" id="Animation_lleyf"]
|
||||
resource_name = "swap_out"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("gun:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.4, 1),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, -0.000397999, 0), Vector3(-0.274662, -0.000397999, 0.0729132), Vector3(1.44543, 1.00681, 2.10684)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("gun:rotation")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.4, 1),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, -1.5708, 0), Vector3(-0.289219, -1.03888, -0.16629), Vector3(-0.221353, -1.10575, -2.02639)]
|
||||
}
|
||||
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_7422e"]
|
||||
resource_name = "swap_in"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("gun:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.7, 1),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(1.44543, 1.00681, 2.10684), Vector3(-0.274662, -0.000397999, 0.0729132), Vector3(0, -0.000397999, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("gun:rotation")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.7, 1),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.221353, -1.10575, -2.02639), Vector3(-0.289219, -1.03888, -0.16629), 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_7422e"),
|
||||
"swap_out": SubResource("Animation_lleyf")
|
||||
}
|
||||
|
||||
[node name="Pistol" node_paths=PackedStringArray("flare_light", "anim_player", "barrel_raycast", "casing_ejector", "mag_ejector", "audio_fire", "audio_empty", "audio_reload") instance=ExtResource("1_frekg")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0145504, -0.0460228)
|
||||
script = ExtResource("2_63tea")
|
||||
gun_name = "Dumb Pistol"
|
||||
fire_mode = 2
|
||||
flare_light = NodePath("SpotLight3D")
|
||||
bullet = ExtResource("3_4pvsf")
|
||||
|
||||
@@ -26,8 +26,8 @@ shadow_color = Color(0, 0, 0, 1)
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_nfpjw"]
|
||||
size = Vector3(3, 3, 3)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_gnkxs"]
|
||||
size = Vector3(11.7881, 6, 11)
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_xfie3"]
|
||||
radius = 6.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)
|
||||
@@ -120,8 +120,8 @@ collision_layer = 0
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="pick_up_magnet"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.457243, -3.73375)
|
||||
shape = SubResource("BoxShape3D_gnkxs")
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.89866, 0, 0)
|
||||
shape = SubResource("SphereShape3D_xfie3")
|
||||
|
||||
[node name="Audio" type="Node" parent="."]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user