Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | TheNewGrant |
Hey there!
I’m trying to tween the offsets property of a gradient but am having trouble doing so. I have two main problems.
1: The offsets property of a gradient texture is a PoolFloatArray and I can’t seem to be able to put arrays into the start and end value parameters of the interpolate_property method and a Vector2() doesn’t work either.
2: I can’t go further into the property to change only a single index of the array (From the data found in the inspector it looks like I should be able to do offsets:indices/0 but an error is thrown instead)
I can use the AnimationPlayer node to animate the offsets property of a gradient, of which the path is texture:gradient:offsets (texture is the texture property of the textureRect I’m using, gradient is the gradient resource I’m using). I notice that the AnimationPlayer node can animate an array without any problems, is there a trick I’m missing to make this work in the Tween node?
I would settle with using the Animation Player node but I can’t seem to be able to make the animation line up with the other tweening animations I have already set up (I dunno how to make an EASE_IN_OUT, TRANS_BACK animation in the Animation Player node work).
If you know how to make a tweening animation work with the offsets property of a gradient, or if you know how to make an EASE_IN_OUT, TRANS_BACK animation work in an AnimationPlayer I would love to hear it.
The two parameters I am having the most trouble with are supposed to be filled with Variants.
Looking at the docs about variants
Variant — Godot Engine (stable) documentation in English
I found that Variants can be arrays (found at bottom of page).
However, whenever I use an array (or a PoolFloatArray which is what the property uses) I get this error:
_calc_delta_val: Invalid parameter type. Supported types are: bool, int, float, Vector2, Rect2, Vector3, Transform2D, Quat, AABB, Basis, Transform, Color.
Why is this working differently than what the docs details? What am I missing?
Also, I learned that I can replace the initial_value parameter in interpolate_property with null which makes this a little bit easier.
TheNewGrant | 2021-04-02 01:03