Making a Zombie: Import Animations into Godot 4 with Blender Non-Linear Animation (NLA)

Поделиться
HTML-код
  • Опубликовано: 21 дек 2024

Комментарии • 3

  • @eisenspanigel67
    @eisenspanigel67 3 месяца назад

    cool

  • @MoogieSRO
    @MoogieSRO 2 месяца назад

    I enjoyed this series, thanks for uploading it. I picked up some tips about NLA that I wasn't aware of before.
    For a better-looking end result, I've found that lerping the movement direction as well as the rotation is better than only lerping the rotation. Since your character changes its move direction immediately, the animation still looks like it's sliding while the rotation of it is still catching up. Does that make sense?
    This is how I addressed that in my own project:
    #Player rotation smoothly interpolated between existing rot + target rot
    var target_rotation_y: float = atan2(-input.x, -input.y)
    rotation.y = lerp_angle(rotation.y, target_rotation_y, delta * angular_accel)
    #Movement direction smoothly interpolated between existing dir + target dir
    var move_direction: Vector3 = Vector3(-sin(rotation.y), 0, -cos(rotation.y))
    velocity += velocity.lerp(move_direction * max_mov_speed, delta * accel)
    (Note: I had to flip the sign of the input and the sin and cos because my character walked backwards without it for some reason!)