Add more guns (#19)
Co-authored-by: Jacklull <rodion.n.rodionov@gmail.com> Reviewed-on: #19
This commit is contained in:
@ -8,7 +8,7 @@ class_name WeaponController extends Node3D
|
||||
# cooldown interval in seconds
|
||||
@export var cooldown: float = 0
|
||||
# bullet speed in m/s
|
||||
@export var bullet_speed: int = 0
|
||||
@export var bullet_speed: int = 200
|
||||
@export var bullet_spread_script: GDScript
|
||||
|
||||
|
||||
@ -17,10 +17,12 @@ func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
@onready var bullet_trace_distance: Node3D = $BulletTraceDistance
|
||||
@onready var bullet_trail_end: Node3D = $BulletTrailEnd
|
||||
@onready var gun_animation = $ShotAnimation
|
||||
|
||||
func shoot() -> Error:
|
||||
var bullet_start_node: Node3D = bullet_trace_distance.find_child("Start")
|
||||
var bullet_end_node: Node3D = bullet_trace_distance.find_child("End")
|
||||
gun_animation.play("shot")
|
||||
if bullet_start_node and bullet_end_node:
|
||||
var path := "res://scenes/weapon/misc/bullet_trail_generic.tscn"
|
||||
if not ResourceLoader.exists(path):
|
||||
|
Reference in New Issue
Block a user