How do I tween the alpha of a MeshInstance3D's material?

Godot Version

4.2

Question

Currently I can change the alpha of a mesh using the line below but I can’t figure out how to change it when using a tween:

$Area3D/MeshInstance3D.mesh.material.albedo_color.a = 0.5

My tween code results in an error:

var tween = create_tween()
tween.tween_property($Area3D/MeshInstance3D, "mesh.material.albedo_color.a", 0.5, 1.0)

I’m not too familiar with 3d, but I think this

“mesh.material.albedo_color.a”

should be

“material:albedo_color:a”

1 Like

Yes, the property string in Tweens is a NodePath, so it should have “:” instead of “.” between properties as shown here:

2 Likes

Thanks for the information, I didn’t realize there was a difference.

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