more bullet testing

This commit is contained in:
derek
2024-10-22 16:46:18 -05:00
parent b70fd94184
commit 3def6de069
6 changed files with 62 additions and 38 deletions

View File

@@ -77,8 +77,6 @@ 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

View File

@@ -1081,7 +1081,7 @@ recoil_amount = Vector3(0.5, 0.1, 0.1)
max_ammo = 6
bullet_damage = 5
bullet_force_mod = 10
bullet_speed = 200
bullet_speed = 1200
bullet_drop = 0.0
random_spread_amt = 0.1
chamber = NodePath("revolver1/Chamber")

View File

@@ -11,7 +11,7 @@ config_version=5
[application]
config/name="First Person Test"
run/main_scene="res://assets/blockout_2.tscn"
run/main_scene="res://scenes/bullet_test.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")
config/icon="res://icon.svg"

View File

@@ -1,10 +1,10 @@
[gd_scene load_steps=9 format=3 uid="uid://dq3pqbjg7o241"]
[gd_scene load_steps=14 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://b5eclfg0cmmal" path="res://assets/revolver_1.tscn" id="3_tt31v"]
[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)
@@ -21,10 +21,53 @@ ssao_enabled = true
sdfgi_enabled = true
glow_enabled = true
[sub_resource type="BoxMesh" id="BoxMesh_fi4o8"]
[sub_resource type="BoxShape3D" id="BoxShape3D_1u1id"]
[sub_resource type="Animation" id="Animation_l1fwm"]
resource_name = "new_animation"
length = 7.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.0105508, 0.7, 1.9, 3.96, 4.16, 4.75514),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 0,
"values": [Vector3(6.78104, 1.26555, -18.3016), Vector3(6.78104, 8.4087, -18.3016), Vector3(-4.99932, 8.4087, -18.3016), Vector3(21.2047, 8.4087, -18.3016), Vector3(21.2047, 8.4087, -18.3016), Vector3(21.2047, 8.4087, 16.4439)]
}
[sub_resource type="Animation" id="Animation_qlawa"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(6.78104, 1.26555, -18.3016)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_dlky4"]
_data = {
"RESET": SubResource("Animation_qlawa"),
"new_animation": SubResource("Animation_l1fwm")
}
[node name="BulletTest" type="Node3D" node_paths=PackedStringArray("player")]
script = ExtResource("1_iqxey")
player = NodePath("Player")
gun_1 = ExtResource("2_bbv4q")
gun_2 = ExtResource("3_tt31v")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_c1yeo")
@@ -47,34 +90,17 @@ 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="AnimatableBody3D" type="AnimatableBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.78104, 1.26555, -18.3016)
[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="MeshInstance3D" type="MeshInstance3D" parent="AnimatableBody3D"]
mesh = SubResource("BoxMesh_fi4o8")
[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="CollisionShape3D" type="CollisionShape3D" parent="AnimatableBody3D"]
shape = SubResource("BoxShape3D_1u1id")
[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
[node name="AnimationPlayer" type="AnimationPlayer" parent="AnimatableBody3D"]
libraries = {
"": SubResource("AnimationLibrary_dlky4")
}
autoplay = "new_animation"

View File

@@ -36,7 +36,7 @@ func _physics_process(delta):
func _on_body_entered(body: Node) -> void:
if !body.is_in_group("player"):
if body.is_in_group("testtest"):
mesh.visible = false
#bullethole effect

View File

@@ -8,7 +8,7 @@ const LAND_CAMERA_TILT : Vector3 = Vector3(-1,0,0)
const WALK_SPEED = 12.0
const SPRINT_SPEED = 15.0
const DASH_SPEED = 40
const SLOWSPEED = .2
const SLOWSPEED = .15
const STAMINA_DRAIN = 100
var speed
@@ -347,8 +347,8 @@ func weapon_tilt(input_x, delta):
func weapon_sway(delta):
mouse_input = lerp(mouse_input, Vector2.ZERO, 10 * delta)
weapon_holder.rotation.x = lerp(weapon_holder.rotation.x, mouse_input.y * weapon_sway_amount, 10 * delta)
weapon_holder.rotation.y = lerp(weapon_holder.rotation.y, mouse_input.x * weapon_sway_amount, 10 * delta)
weapon_holder.rotation.x = lerp(weapon_holder.rotation.x, mouse_input.y * weapon_sway_amount, 5 * delta)
weapon_holder.rotation.y = lerp(weapon_holder.rotation.y, mouse_input.x * weapon_sway_amount, 5 * delta)
func weapon_bob(vel : float, delta):
if weapon_holder: