如何同时播放多个动画?

发布于 2025-01-19 19:45:22 字数 597 浏览 1 评论 0原文

我正在尝试一次播放2个动画

例如, ,例如
我的手臂有动画:staticrunned_swing& 绘制武器
我的腿有动画:static运行

,我想同时播放它们,例如:
ARMS Running_swing&amp;腿<代码>运行或
武器绘制武器&amp;腿<代码>运行

到目前为止,我发现的唯一方法是创建2个独立的animationplayer s
并互相播放一个:

$AnimationPlayerArms.play("running_swing");
$AnimationPlayerLegs.play("running");  # but this approach too isn't simultaneous

或使用tween,但是该方法也失败了,因为动画的复杂程度越多,

所以我可能会缺少任何方法或方法吗?

I'm trying to play 2 animations at once

for example,
my arms have the animations: static, running_swing & drawing weapon
my legs have the animations: static, running

and I want to play them both, simultaneously in any combination like:
arms running_swing & legs running or
arms drawing weapon & legs running

so far the only way I found was to create 2 separate AnimationPlayers
and play them one after the other:

$AnimationPlayerArms.play("running_swing");
$AnimationPlayerLegs.play("running");  # but this approach too isn't simultaneous

or use Tween but that approach also fails because it becomes really difficult the more the animations are complicated

So is there any way or method that I might be missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔一刀 2025-01-26 19:45:22

您可以使用AnimationTree

像往常一样,设置AnimationPlayer,然后将Active> Active 设置为true。

对于tree_root设置新AnimationNodeBlendTree。然后为每个动画制作动画节点。通过混合节点将它们连接在一起(我使用0.5进行混合值)。最后,我将在结束时添加一个搜索节点以控制它。

AnimationTree将为混合值和寻求值添加参数。将Seek参数设置为0将重新启动两个动画。

只要动画不设置相同的变量,您就会具有理想的效果:两个动画播放。如果动画设置相同的变量,则将在两者之间进行插值,并由混合值控制。

You can use an AnimationTree.

As usual, set the AnimationPlayer, and set active to true.

For the tree_root set new AnimationNodeBlendTree. Then make an Animation node for each of your animations. Connected them together via Blend nodes (I'd use 0.5 for the blend value). And I'll add a Seek node at the end to control it.

AnimationNodeBlendTree setup

The AnimationTree would have added parameters for the blend values and the seek value. Setting the seek parameter to 0 will restart both animation.

As long as the animation do not set the same variable, you have the desired effect: both animation play. If the animations set the same variable, you get an interpolation between the two, controlled by the blend value.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文