GDevelop
GDevelop copied to clipboard
3D model animation actions/conditions
Description
There isn't currently a way to restart an animation that is already playing. With 2D sprites you can set the frame of the animation back to 0. But that isn't the case with 3D models.
Solution suggested
Allow animations to be restarted in the same way as sprite animations.
(Edit: The animation can be restarted by switching the animation to something else before changing it to the one you want to use, but this is sort of a "hack" solution. It would be better if the time elapsed action worked as consistently as the frame action, allowing users to reset animations during and after the animation has finished playing.)
@HelperWesley @4ian Is this still available? If so, I would like to contribute
@stanikeva Yes please, you're welcome to contribute a PR to add this :)
I would like to contribute
Feel free to start working on an issue, no need to ask for permission (though discussion can be useful if it's a complex problem) :)
@HelperWesley, @4ian Good evening, could you please provide a bit more information about this issue? Maybe where in the pipeline this feature is implemented in the 2D sprites so we can start from there? Also maybe where would this new implementation go in the code? Thank you for your time!
There isn't currently a way to restart an animation that is already playing. With 2D sprites you can set the frame of the animation back to 0, or switch to a different animation and then back to the one you want to restart. But that isn't the case with 3D models.
Actually, the following action can be used on any object that has animations:
@D8H @kitsiosvas
The elapsed time action doesn't work once an animation has finished playing, so it's inconsistent, and doesn't work as consistently as the frames action does for 2D sprites.
https://github.com/user-attachments/assets/19349bff-3ccc-4cf7-8774-dc4dcfb3b8e6
@HelperWesley thanks for the analysis. If you still have the project, sending it here would be a great addition to the issue for contributors to have a reproductible bug. @kitsiosvas @stanikeva @Ahmad986Ferdaws I think you have everything to submit a PR:
- The action that should work (you can search the sentence in the codebase in order to get the function that is executed in game)
- The fact that it does work for Sprites but not 3D models (both are
Animatableobjects) so it can be considered as a bug. Plus you can have a look at the sprite object way of doing things to get ideas about how to fix this for 3D models.
Closing this since I think it's been fixed in the latest release. Feel free to re-open if there is still an issue.