Help! Godot thinks Albedo_color property is an Object instead of a Color?

Godot Version

4.3 alpha 3

Question

Why does Godot think that albedo_color property is an Object instead of a Color here?

I already tried several other types of paths using : and ^ but this is the only way that I don’t get "The tweened property “surface_material_override/0:albedo_color:a” does not exist in object “MeshInstance3D:<MeshInstance3D#107810393126>”.

I also tried just replacing the alpha property with a float, but still same issue:
var transition_length := 1.0
func turn_invisible(duration: float = 10.) → void:
if inv_tween:
inv_tween.kill()
push_warning(“Turning invisible”)
get_tree().create_timer(duration).timeout.connect(reset_invisibility)
inv_tween = get_tree().create_tween()
inv_tween.tween_property(mesh, “surface_material_override/0/albedo_color/a”, 0.0, transition_length)
inv_tween.parallel().tween_property(left_eye, “surface_material_override/0/albedo_color/a”, 0.0, transition_length)
inv_tween.parallel().tween_property(right_eye, “surface_material_override/0/albedo_color/a”, 0.0, transition_length)
hide()

I know that it is the correct material because it understands the whole path, it just sees it as an object and not a color, is this an Engine bug??

Ok, I fixed it thanks to someone in the discord…
Apparently you are not supposed to access the Material from the Mesh Instance in a Tween
I had to first make a material variable, assign it and then tween that material…
I guess that is the intended method, but I thought I could access subresources in a Tween.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.