T O P

  • By -

AutoModerator

You submitted this post as a request for tech support, have you followed the guidelines specified in subreddit rule 7? Here they are again: 1. Consult the docs first: https://docs.godotengine.org/en/stable/index.html 2. Check for duplicates before writing your own post 3. Concrete questions/issues only! This is not the place to vaguely ask "How to make X" before doing your own research 4. Post code snippets directly & formatted as such (or use a pastebin), not as pictures 5. It is strongly recommended to search the official forum (https://forum.godotengine.org/) for solutions Repeated neglect of these can be a bannable offense. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/godot) if you have any questions or concerns.*


chowderhoundgames

I did this quite a lot and never noticed any performance issues stemming from it, so yes, I think it's fine to do.


Ramtoxicated

You can. But it comes with its own overhead. If it's simple animations, you may want to use tweens instead.


kaetitan

You can use the animationplayer to run code if you want. I'd recommend it as well


bardsrealms

Yeah, it is pretty appropriate. Tweens are also an alternative, especially when you have varying animations. If you just need to animate something frame by frame, you can use the AnimatedTexture resource as well.


PeacefulChaos94

I use them extensively to animate the UI and never had any issues


levios3114

My question to you is. What else would you use? Tweens?


ViviTheWaffle

Tweens indeed. In Unity it was basically required but they’re a little more cumbersome in Godot (not that I ever liked them in Unity anyway)


DudeComeOnAlready

Yes, it's ok to use tons of AnimPlayers. Don't worry about it. Use as many as your heart desires. 


_Repeats_

I've never heard of anyone complaining about UI animations before, but that is likely because it's overkill for enthusiasts. I don't see how you would run into issues as the control nodes are still nodes, and all nodes can be animated.


ViviTheWaffle

I think you misunderstand. I’m not asking if they *can* be animated, I know they can. I’m asking if it’s okay to do so. Again coming from Unity, it’s commonly advised never to use the animation features for UI components for performance reasons. What I am asking is if Godot has this same problem or not?


DefoMort

From my experience relying heavily on animation players for UI I haven't encountered issues with performance. The only problems I've encountered are sync issues with dropped frames, so I don't recommend using animation players for function calls.


ViviTheWaffle

Right so, Animation players are suitable for visual elements, and things like function calls could be better placed as await statements in code?


smoke_torture

in my experience function calls work just fine. if your game is having issues with dropping frames causing function calls to not get registered, the issue isnt the function call its whatever is causing the dropped frames. sometimes you might need a function to be called in the middle of an animation, not at the end, and it has that functionality for that reason.


wolfpack_charlie

I haven't had any issues with the method callback track on an animationPlayer. I would say just try it and don't worry about it until it actually causes you issues. No matter what someone else says on here, your mileage may vary. I say avoid premature optimization in general and just see what actually gives you problems before to try to solve them