Added new trees

This commit is contained in:
2024-02-13 16:45:38 +01:00
parent c35d849fc6
commit 5caf5f6c71
4 changed files with 36 additions and 14 deletions

View File

@ -1,5 +1,7 @@
extends Node3D
@export var tween_duration := 0.5
var particles: GPUParticles3D
var trails: GPUParticles3D
var attractor: GPUParticlesAttractor3D
@ -29,15 +31,13 @@ func on_body_entered(body: Node3D):
attractor.visible = false
area.set_deferred("monitoring", false)
particles.process_material.attractor_interaction_enabled = true
var duration := 0.5
var tween = get_tree().create_tween()
tween.parallel().tween_property(particles, "amount_ratio", 0, duration)
# tween.parallel().tween_property(trails, "amount_ratio", 0, duration)
tween.parallel().tween_property(light, "light_energy", 0, duration)
tween.parallel().tween_property(sprite, "scale", Vector3.ZERO, duration)
tween.parallel().tween_property(sprite, "material_override:albedo_color", Color(0, 0, 0, 0), duration)
tween.parallel().tween_property(particles, "amount_ratio", 0, tween_duration)
# tween.parallel().tween_property(trails, "amount_ratio", 0, tween_duration)
tween.parallel().tween_property(light, "light_energy", 0, tween_duration)
tween.parallel().tween_property(sprite, "scale", Vector3.ZERO, tween_duration)
tween.parallel().tween_property(sprite, "material_override:albedo_color", Color(0, 0, 0, 0), tween_duration)
await tween.finished
await get_tree().create_timer(2.0).timeout
queue_free()
# tween.tween_callback(queue_free)