how to tween a parameter? Keep getting "Tween target object has no property named"

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By obsercard_d

So I’m having an issue with trying to use a tween to change a shader parameter.

I’m using the following:

tween.interpolate_property(get_node("."), "shader_param:cutoff",
	0.0, 1.0, 1,
	Tween.TRANS_EXPO, Tween.EASE_IN_OUT)

The inspector looks like this and this is the parameter I am trying to tween.
enter image description here
So the parameter definitely exists but I have no idea how to get its property to change because every time I try, this happens.

_build_interpolation: Tween target object has no property named: shader_param:cutoff.

I have tried “shader_param/cutoff” and “:shader_param:cutoff”…
I have looked through the docs for this and I can’t find anything about it. I am using v3.2.1.stable.official

:bust_in_silhouette: Reply From: kidscancode

Look where you’re hovering. shader_param:cutoff is a property of the shader material object, not of the node.

That would make sense. I will try to use that as a starting point, assuming get_node("./shader") or similar will actually get to the correct thing haha

obsercard_d | 2020-06-29 05:27

A comment saying “use get_material() instead of get_node” would have been VERY HELPFUL…

obsercard_d | 2020-06-29 21:14

Help is provided on a best-effort basis. Feel free to edit your first post to mention get_material() still :slight_smile:

Calinou | 2020-06-30 09:23