4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.46k stars 837 forks source link

3D model animation actions/conditions #6953

Open HelperWesley opened 2 weeks ago

HelperWesley commented 2 weeks ago

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.)

stanikeva commented 2 weeks ago

@HelperWesley @4ian Is this still available? If so, I would like to contribute

4ian commented 2 weeks ago

@stanikeva Yes please, you're welcome to contribute a PR to add this :)

Ahmad986Ferdaws commented 2 weeks ago

I would like to contribute

4ian commented 2 weeks ago

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) :)

kitsiosvas commented 1 week ago

@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!

D8H commented 1 week ago

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:

image

HelperWesley commented 1 week ago

@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