Start animation where previous animation left off
Asked Answered
S

4

0

Imagine Mega Man running, and then he starts shooting while running, it goes seamlessly and the run cycle does not restart. How do you do that? Is there a way to tell the next animation to start, not at the beginning, but from the position where the current animation is at in it's cycle?

Simla answered 20/11, 2023 at 8:22 Comment(0)
C
1

For 2D, you need animation tracks that line up with each other, and when you switch from one to the other say from walking to shooting, you need to make sure you are at the same time in the new animation as you were in the old animation. You can do this in Godot via the AnimationTree. The BlendTree and the StateMachine are both capable of doing this.

You can also do this using the simpler AnimationPlayer by setting the time yourself using seek(). Here is a small example you can drop in a project:

walking.zip
8kB
Claudette answered 20/11, 2023 at 9:30 Comment(0)
C
1

There are several ways of handling that. Are you thinking of 2D or 3D?

Claudette answered 20/11, 2023 at 8:32 Comment(0)
S
0

Claudette It's 2d, with simple sprite based animations. Sometihing like Mega Man or Contra on the NES.

Simla answered 20/11, 2023 at 8:34 Comment(0)
C
1

For 2D, you need animation tracks that line up with each other, and when you switch from one to the other say from walking to shooting, you need to make sure you are at the same time in the new animation as you were in the old animation. You can do this in Godot via the AnimationTree. The BlendTree and the StateMachine are both capable of doing this.

You can also do this using the simpler AnimationPlayer by setting the time yourself using seek(). Here is a small example you can drop in a project:

walking.zip
8kB
Claudette answered 20/11, 2023 at 9:30 Comment(0)
S
0

Claudette Thank you!! That is very cool!!!!!

Simla answered 20/11, 2023 at 10:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.