added crown, tweaks with muzzle smoke
This commit is contained in:
@@ -11,6 +11,7 @@ extends Node3D
|
||||
@export var max_ammo = 15
|
||||
@export var start_mags = 3
|
||||
@export var bullet_damage = 1
|
||||
@export var smoke_enabled : bool = false
|
||||
@export var bullet_force_mod = 5.0
|
||||
@export var bullet_speed = 150
|
||||
@export var bullet_drop = .3
|
||||
@@ -38,6 +39,7 @@ extends Node3D
|
||||
|
||||
@onready var player = get_tree().current_scene.player
|
||||
@onready var level_control = get_tree().current_scene
|
||||
@onready var muzzle_smoke = preload("res://assets/muzzle_smoke.tscn")
|
||||
@onready var ammo_current
|
||||
|
||||
var start_position
|
||||
@@ -95,6 +97,8 @@ func shoot(delta):
|
||||
bullet_fire()
|
||||
hitscan_fire()
|
||||
spawn_casing()
|
||||
if smoke_enabled:
|
||||
spawn_muzzle_smoke()
|
||||
player.recoil.add_recoil(Vector3(0,recoil_amount.y,recoil_amount.z),10,10)
|
||||
player.recoil.add_gun_recoil(recoil_amount.x)
|
||||
#player.velocity += player.bullet_ray.global_basis * Vector3(0,0, kick_amount)
|
||||
@@ -130,6 +134,12 @@ func spawn_casing():
|
||||
instance_casing.player_velocity = player.velocity * transform.basis
|
||||
get_tree().get_root().add_child(instance_casing)
|
||||
|
||||
func spawn_muzzle_smoke():
|
||||
var instance_smoke = muzzle_smoke.instantiate()
|
||||
instance_smoke.global_transform.basis = barrel_raycast.global_transform.basis
|
||||
|
||||
add_child(instance_smoke)
|
||||
|
||||
func bullet_fire():
|
||||
var instance_bullet
|
||||
if hitscan_enabled:
|
||||
|
||||
Reference in New Issue
Block a user