0 votes

I have two animations of 13 frames
One is canned Basic - Run and the other is called Basic- RunAtk

When I press a button to attack, I want the animation tree to go from Basic - Run to Basic - RunAtk but I want the transition to be seemless.

For instance, if the previous animation was in frame 7, I'd like the nest one to start at frame 8. Is there anything I can do to make it happen?

if move_dir != 0 and grounded:
    animation_state.travel("Basic - Run")
if move_dir == 0 and grounded:
    animation_state.travel("Basic - Idle")
if timedash < 0 and grounded and move_dir != 0:
    animation_state.travel("Basic - Dash")
if not grounded and y_velocity < 0:
    animation_state.travel("Basic Jump - Transition")
if not grounded and y_velocity >= 0:
    animation_state.travel("Basic Jump - Fall Loop")
if wall_slide:
    animation_state.travel("Basic - Wall Slide Loop")
if wall_slide and y_velocity < 0:
    animation_state.travel("Basic - Wall Jump")
if (left_ray.is_colliding() or right_ray.is_colliding()) and Input.is_action_just_pressed("Jump"):
    animation_state.travel("Basic - Wall Jump")
Godot version 3.4
in Engine by (16 points)

1 Answer

0 votes

You can use the transition type called "Sync", which continues the next state where the last one was stopped.

This is also explained here:
https://docs.godotengine.org/en/stable/tutorials/animation/animation_tree.html

by (318 points)

You can use the transition type called "Sync", which continues the
next state where the last one was stopped.

That doesn't really work, though. It just waits until the animation is finished to play the next frame.

What I want is, for instance, if the first animation was at frame 5 when I hit the shoot button, the next animation should start on frame 6.

I keep trying and I have no idea what to do to make it work.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.