-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AnimationPlayer play() does not play anymore when the same animation is playing. #34125
Comments
"anymore" compared to which version? |
I tested 3.1, 3.1.1, 3.1.2 and the current master branch, they all give the same behavior described above. If you want to reset the animation to restart it, you can use:
|
Yes, those give me the same results as well. It's definitely working in 3.0.6: Damnyou Githup UI! Sorry for the accidental close, I was trying to close the comment I was writing, not the whole issue. |
This was changed on purpose in 3.1, I'll push an update to the docs to clarify. |
@akien-mga What exactly is the purpose behind this? |
Probably code like this
I haven't written code like this for a long time, so I didn't even notice this now works. Lots of people had problems with animations resetting. |
It defies logic. We take a lot of effort to teach people how _process() is called every frame and _physics_process() is called every physics frame and then ... this??!? Having to add stop every time you want The Animationplayer to start playing is completely illogical on the other hand and adds completely unnecessary code. Don't get me started on stop (true). That makes about as much sense as the playback GUI godotengine/godot-proposals#167 This is so bad. And here I thought I already saw rock bottom with the AnimationPlayer "improvements" in 3.1. |
From my experience, you more often have to check if animation isn't played yet than want to restart it. |
I remember making it so that Not sure what has to be done here. I feel that either play's behavior should be reverted to always reset or that |
Pls no. The resetting could be made optional behavior if there's demand for it (which brings Godot proposals here). Either as an argument for play() or a new method. |
Play() worked perfectly fine before 3.1 If you call play(), it plays If you run play in either _process() or _physics_process() you immediately learned what either of those functions do. Now, you learn nothing and play() is behaving differently from any other function you would call in either of those processes. Besides where is the discussion for this? This is so elemental to the AnimaitonPlayer behavior and it seems like it has been implemented without any prior discussion. This should be reverted. |
I use this a lot and I don't care that much. but the first time I tried to use it I found this a little bit confusing too. Maybe this could be a good choice to make a pause function instead of a stop(false) one, the new godot users could reap the benefits of this. And the play() could stay as the 'play' and the 'resume" actions. Maybe changing the |
The compatibility breakage was done on purpose in #25776 for 3.1, and while I agree that it could have used more discussion, it doesn't make sense to backtrack and break compatibility again for 3.1 users. The current behavior is consistent and #34128 documents it well. As mentioned, the previous behavior can be obtained by simply calling For 4.0, we can discuss (in a proposal) changing the API again to make it more explicit. I think it would be worth having There should also be a cleanup around the |
That's a misunderstanding due to unclear documentation (fixed in #34128).
|
Listen @akien-mga and @KoBeWi I think you are focusing on a wrong problem here without seeing a bigger picture. I agree with @golddotasksquestions the issue is not how often play() is used but how it defines the logic of the engine. If engine calls every function every frame inside the physics process. It should call every function every frame inside physic process INCLUDING play() function. It is vital that engine behaves in a predictable way that user can understand without spending couple of hours on discord/reddit and docs to find out that something is yet another exception to how you would expect engine to behave. The issue isn't the fact that you want to use play() one way or the other the issue is the fact that docs lie to you when they say "process function calls each function every frame". The more exceptions we have the harder to intuitively use. The moment docs mislead you like this is the moment you stop trusting documentation and this is the moment when you may as well simply not have it. The primary issue is not what is easier to use but what should be expected from the engine. If something is slightly less practical but promotes consistency and intuitive use it should stay that way. Logic of how the process function works demands that play() is called every frame just like any other function is. |
@Feniks-Gaming You misunderstand the issue.
If it's already playing, then it keeps playing. That doesn't mean that |
It makes sense but if that is a case play() should be renamed to something else. When call play() on AudioStreamPlayer it doesn't act the same way than calling play() on AnimationPlayer either every node that has play() function should behave consistently or if one of the nodes doesn't then it's function should be renamed. |
@Feniks-Gaming Hence:
|
I that would work spot on in my opinion. Why wait till 4.0 is it not something we could bring with 3.2.1 for example? Is the issue created in proposal for this or do we need to make one? |
That would break compatibility, which should not happen in maintenance releases like 3.2.1. And there's little justification for breaking compatibility in 3.2 itself with regard to the new behavior in 3.1, as the new behavior is working properly and used in production by many.
I don't think there is one yet. It should be opened in https://github.com/godotengine/godot-proposals, ideally with a proposal for what the new public API should be (i.e. the methods and properties that AnimationPlayer would have in 4.0, especially the ones that would be added/removed/renamed/modified). Edit: Having a full proposal is not a requirement for opening the issue though, I just mean that it's what the issue should eventually lead to, so that we have something concrete and well designed to implement. |
I am happy to work on proposal maybe collaborate with @golddotasksquestions to make a draft of one. |
Sorry @akien-mga , but that's BS: This change also broke compatibility from 3.0.6 to 3.1. There was literally no discussion about this what so ever. Neither #25745 nor #17423 have a discussion about changing the Added functionality is always good. Breaking things, or forcing confusing workflow onto people for everyday-use basic things, is not! I'm all for discussing The added functionality of the absurd |
Who would want this and especially ... why??? Why would you want this:
instead of this: It's great that we can pause animation now with one line of code instead of 3. But this has nothing to do with asking the AnimationPlayer to start playing an animation. |
Yes, and that's OK when justified. We can argue all you want about whether this was justified (and I called it in #25776 (comment), but it seems it was not added to the changelog in the end). Breaking compatibility between two minor version (3.0 and 3.1) is something we do when fixing bugs, but not in maintenance release, as in my comment that you're reacting to (3.2 to 3.2.1, or 3.0 to 3.0.6). It is normal that when moving between major (3.x to 4.x) or minor (3.0 to 3.1) versions, some changes may be necessary to your projects to keep a behavior that has been modified in a compatibility breaking way in a later version. You may disagree with the justification for breaking compatibility, but it's done, and thousands of users have started projects with Godot 3.1 or later and are relying on the current behavior. Reverting it would break compatibility again, so it should only be done if there's a very strong reason to do so. I don't see one myself, as mentioned I think the current behavior makes sense and provides more features than what 3.0 offered. I agree that the API is confusing, but it's working as designed, so its design could be reviewed in the next big compatibility breakage (4.0).
You're still conflating Again, it's fine to disagree with the decision taken to use
I wrote or, not and. You can use either But we're running around in circles here, I explained things very clearly already above on the comments you downvoted. And BTW if you're here to call my explanations "bullshit", I'd prefer not to engage further with you. |
You can try this on your example project to understand what is now possible and was not in 3.0:
LMB will restart as you wanted, and RMB will let you pause and resume the animation, and restart it too once it finishes. |
It may work but it's confusing as hell what does a a |
Again, I agree, which is why I suggest refactoring this in 4.0. Until then, reading the documentation or the auto-completion tooltip will tell you that the boolean argument is named "reset", which gives a good hint as to what |
I think we agree on functionality we disagree on a time frame proposed. 3.0 ->3.1 was happy to break functionality why is 3.1->3.2 breaking functionality a problem? |
I'm calling things "BS" when I feel like they are an expression of a double standard. If you @akien-mga would also see the change of The 3.1 3.0.6 had This just adds another nail to the coffin that is a number of failed "improvements" to the AnimaitonPlayer in 3.1. It makes me sad. Because the AnimationPlayer in 3.0.6 though not perfect, was a great tool, and it has become more and more downgraded. :( |
Godot version: 3.1.2 stable
OS/device including version: Win7
Issue description:
The AnimationPlayer won't interrupt itself anymore to start playing the same animation anew on play(). When another animation than the current one is asked to be played, interrupting works as usual.
This is highly problematic as it breaks a lot of code in action games or anything that needs immediate user feedback.
This completely breaks my main project.
Steps to reproduce:
Make an animation that lasts for a few seconds to easily see the effect, trigger the animation in your process or physics_process through input, run and try to make the animation play again while it is still playing.
This used to work, but does not anymore:
Minimal Reproduction Project:
AnimationPlayer_cannot_interrupt.zip
The text was updated successfully, but these errors were encountered: