15 lines
449 B
GDScript
15 lines
449 B
GDScript
extends ColorRect
|
|
|
|
## Node which will change offset. If null, offset is constant
|
|
@export var tracked_node: Node2D
|
|
## Shortcut to get_parent()
|
|
@onready var star_system = get_parent()
|
|
## Color of nebula.
|
|
@export var color_background: Color
|
|
|
|
func _ready():
|
|
material.set_shader_parameter("nebula_color", color_background)
|
|
|
|
func _physics_process(_delta):
|
|
if tracked_node != null:
|
|
material.set_shader_parameter("offset", tracked_node.global_position)
|