improved cronies
This commit is contained in:
parent
dd17c93d48
commit
adc5281f77
3 changed files with 12 additions and 13 deletions
|
@ -5,6 +5,8 @@ extends CharacterBody3D
|
|||
@export_range(0,1,1,"or_less","or_greater","radians_as_degrees")
|
||||
var rotation_speed: float
|
||||
@export var death_delay: float
|
||||
@export var sound_pitch_min: float
|
||||
@export var sound_pitch_max: float
|
||||
|
||||
@export_group("Node References")
|
||||
@export var model: Node3D
|
||||
|
@ -29,7 +31,6 @@ func _physics_process(delta: float) -> void:
|
|||
func _on_player_detector_body_entered(body: Node3D) -> void:
|
||||
if body is Player:
|
||||
model.visible = false
|
||||
death_sound.pitch_scale = randf_range(sound_pitch_min, sound_pitch_max)
|
||||
death_sound.play()
|
||||
var tween = create_tween()
|
||||
tween.set_process_mode(Tween.TWEEN_PROCESS_PHYSICS)
|
||||
tween.tween_callback(queue_free).set_delay(death_delay)
|
||||
get_tree().create_timer(death_delay, false, true).timeout.connect(queue_free)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue