![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Ben Rolfe |
I’m animating my character’s eyes by changing the UV offset of the material along the x-axis, to make them squint, look left or right, blink, etc.
I am separately setting the y-offset with code, to change the style of the character’s eyes (with lashes, without, etc). My problem is that the animation is overriding this y value and setting it back to 0.
Is there a way to make an animation control the x-offset without changing the y-offset? Or do I need to use a separate texture for each eye style?
Thanks!
By animate with code, do you mean interpolation with Tween? If so, try:
interpolate_property(material, "uv1_offset:x", init_val, final_val, duration)
Otherwise, show us your code so that we can better understanding your frustration.
imjp94 | 2020-03-26 14:57
Thank you imjp94!
Sorry I was unclear, I’m not trying to animate with code, I’m changing the y-offset of the UVs with code and the x-offset with animation, but the animation was overriding my code changes.
Your answer pointed me in the right direction - I just had to add “:x” at the end of my animation track, and that fixed it.
Ben Rolfe | 2020-03-27 05:36