Animation Player won't auto play
Hi!.
Create root Node2D, add a sprite. Add an AnimationPlayer as a child of it, or next to it as a child of Node2D. Create a new animation. Edit the animation so it changes the sprites position over time. Edit the animation resource so that it loops. Now select the AnimationPlayer and change the play property to the animation you just created it plays automatically in the editor... so far so good, pretty nice work flow.
BUT when you hit: test scene, the animation won't auto play. You can add a piece of code that tells the AnimPlayer to play in _ready but you shouldn't have to, i believe
possibly related to #876
I can't reproduce this, the autoplay button is the one that looks like this [A> can you make a little scene for me to test?
oh my god, i feel so stupid, i'm closing this, sorry
I had the same stupid problem and found this issue. Now I can get rid of a couple of scripts :p Could there be a better way to show this on the GUI? I expected it to be in the inspector tbh (isn't the active boolean enough when set to true?)
I think it needs a more obvious icon or a property in the inspector. I have been looking for a better icon but I couldn't find a good one. Maybe it should show as an icon+label in the animation editor. Before opening this post, I spent 20 minutes looking for the button, an I was about to write code to auto-start the animation, and I think many new Godot user will face that issue too.
I got burned by this, too. I was completely mystified when nothing happened in Play Scene. Google brought me here.
This was very hard for to me find as well, not very intuitive. I expected to find an option for this in the inspector. Perhaps this should be considered a UX issue?
@nsrosenqvist Please open a proposal on the Godot proposals repository about this.
The Autoplay property is stored in the AnimationPlayer node, but it stores a string property that can only match one animation at a given time. This is why it's currently hidden in the inspector.
Exposing it will require adding a dynamic property hint generator that returns a list of animations associated to the AnimationPlayer, as it shouldn't be possible to enter invalid animation names. I believe there are other nodes where this is already done, but I can't remember any examples right now.
Once this is done, the Autoplay button can be removed in the animation editor as it'll be superseded by the Autoplay property in the inspector.
Oh man got hung up on this too! Was about to start scripting it. Please just replace that terrible icon with "Autoplay" already.
Unnecessary sharp edge since 2014...
Oh man got hung up on this too! Was about to start scripting it. Please just replace that terrible icon with "Autoplay" already.
Unnecessary sharp edge since 2014...
Being very direct to the point, this is a design flaw It's not intuitive and I'm glad I found this thread because I see I'm not the only one
PROBLEM
-> This is a Button and it has an ON/OFF behavior
EASY SOLUTION
It could be either a
- Switch
- Checkbox