Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | jarlowrey |
$Particles2D.material.color = load(str("res://src/UI/Color/Red.tres"))
Throws an error because Red.tres
is a Gradient. Is it possible to this property to a gradient from scripting?
It looks like its something like $Particles2D.material.trail_color_modifier.gradient = load(str("res://src/UI/Color/Red.tres"))
, but I’m getting a material is null
error…
jarlowrey | 2018-02-17 16:29
This does not throw any errors, but the color is not changing
var grad = GradientTexture.new()
grad.gradient = load(str("res://src/UI/Color/Red.tres"))
$Particles2D.process_material.trail_color_modifier = grad
jarlowrey | 2018-02-17 16:34