Godot Version
4.6.1
Question
I’ve been looking into UI animation recently and I’m not entirely sure how you’re meant to handle it nicely?
Most guides I see are in regards to very simple UI, such as a button hover effect. Though I’m confused on how to handle more complex elements.
For instance, if you have an element that’s essentially a button, but is composed of many different control elements, like a border, image, etc underneath a root control node. What is the proper way to animate it?
My first thought would be to use tweens, but having a reference to every node I want to animate seems a bit messy I suppose? Though this is probably the correct answer and I should just live with it.
An alternative thought I had was an animation player, but I’m not entirely certain how your meant to transition between something like a OnHover animation to a OnClick animation without it breaking, as it did when I tested it. If there’s a functional proof of concept of this I would be very interested, as this would drastically reduce the complexity of animations, especially in regards to values within Themes, which feel incredibly annoying to try and manipulate in code.
I’ve seen a video use composition, where they had an animation component, but I can’t imagine that being very scalable. An element’s animations feels as though it could be way too many things to reasonably stuff it under a single script. Not to mention attaching a script and having to click between nodes just to modify a property seems a bit exhausting if you have need for a lot of animations.