2025-01-26 09:59:59 +00:00
|
|
|
extends MeshInstance3D
|
|
|
|
|
2025-01-26 13:39:11 +00:00
|
|
|
var alpha = 1.0
|
2025-01-26 09:59:59 +00:00
|
|
|
func init(pos1, pos2):
|
|
|
|
var draw_mesh := ImmediateMesh.new()
|
|
|
|
mesh = draw_mesh
|
|
|
|
draw_mesh.surface_begin(Mesh.PRIMITIVE_LINES, material_override)
|
|
|
|
draw_mesh.surface_add_vertex(pos1)
|
|
|
|
draw_mesh.surface_add_vertex(pos2)
|
|
|
|
draw_mesh.surface_end()
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready() -> void:
|
2025-01-26 13:39:11 +00:00
|
|
|
var dup_material = material_override.duplicate()
|
|
|
|
material_override = dup_material
|
2025-01-26 09:59:59 +00:00
|
|
|
pass # Replace with function body.
|
|
|
|
|
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
|
|
func _process(delta: float) -> void:
|
2025-01-26 13:39:11 +00:00
|
|
|
alpha -= delta * 3.5
|
|
|
|
material_override.albedo_color.a = alpha
|
2025-01-26 09:59:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_timer_timeout() -> void:
|
|
|
|
queue_free()
|