create player hurt effect
This commit is contained in:
@@ -13,6 +13,7 @@ var _sfx_audio_playback_polyphonic: AudioStreamPlaybackPolyphonic
|
||||
@onready var _bone_flipper: BoneFlipper = $"../Model/Armature/Skeleton3D/BoneFlipper"
|
||||
|
||||
@onready var _sfx_audio_player: AudioStreamPlayer3D = $"../Audio/ScriptSFXPlayer"
|
||||
@onready var _hurt_particles: GPUParticles3D = $"../Effects/HurtParticles"
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -84,6 +85,12 @@ func _on_attack_attacked() -> void:
|
||||
|
||||
func _on_stats_damaged() -> void:
|
||||
_play_sound(_hurt_sound)
|
||||
_hurt_particles.restart()
|
||||
_hurt_particles.emitting = true
|
||||
for node in _hurt_particles.get_children():
|
||||
if node is GPUParticles3D:
|
||||
(node as GPUParticles3D).restart()
|
||||
(node as GPUParticles3D).emitting = true
|
||||
|
||||
|
||||
func _on_music_track_started() -> void:
|
||||
|
||||
Reference in New Issue
Block a user