Make it possible to dynamically set weapon parans

This commit is contained in:
2025-01-28 10:51:45 +01:00
parent 06a1d28e42
commit b54ffaeb0d
11 changed files with 106 additions and 83 deletions

View File

@ -1,18 +0,0 @@
extends Node3D
const SPEED = 10
@onready var mesh = $Object_10
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
position += transform.basis * Vector3(0, 0, SPEED) * delta
func _on_timer_timeout():
queue_free()

View File

@ -1,6 +1,4 @@
[gd_scene load_steps=5 format=4 uid="uid://dn6imke7vnimn"]
[ext_resource type="Script" path="res://scenes/weapon/guns/ak/bullet.gd" id="1_rbbkb"]
[gd_scene load_steps=4 format=4 uid="uid://dn6imke7vnimn"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ledbj"]
resource_name = "stell"
@ -45,7 +43,6 @@ shadow_mesh = SubResource("ArrayMesh_mgmay")
[node name="Bullet" type="Node3D"]
transform = Transform3D(10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0)
script = ExtResource("1_rbbkb")
[node name="Object_10" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)

View File

@ -1,10 +0,0 @@
extends MeshInstance3D
var trail_length = 2.0
var speed = 10.0
func _process(delta):
global_transform.origin += transform.basis.z * speed * delta
scale.x = max(scale.x - delta, 100)
scale.y = max(scale.y - delta, 100)
scale.z = max(scale.z - delta, 100)

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=55 format=4 uid="uid://dtvo21mk1webd"]
[ext_resource type="Script" path="res://scenes/weapon/guns/ak/with_hands.gd" id="1_2iqts"]
[ext_resource type="PackedScene" uid="uid://dab7jttp7ywfh" path="res://scenes/weapon/guns/ak/gun.tscn" id="1_aaafm"]
[ext_resource type="Script" path="res://scenes/weapon/generic_weapon_controller.gd" id="1_h1xyo"]
[ext_resource type="PackedScene" uid="uid://bjyltbtx45cqs" path="res://scenes/weapon/misc/bullet_trace_distance.tscn" id="3_5ff4y"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tg27p"]
@ -553,7 +553,10 @@ blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_he3sr")
[node name="WithHands" type="Node3D"]
script = ExtResource("1_2iqts")
script = ExtResource("1_h1xyo")
damage = 50
cooldown = 0.2
bullet_speed = 200
[node name="Gun" parent="." instance=ExtResource("1_aaafm")]