如何同时播放多个动画?
我正在尝试一次播放2个动画
例如, ,例如
我的手臂有动画:static
,runned_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 AnimationPlayer
s
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
AnimationTree
。像往常一样,设置
AnimationPlayer
,然后将Active> Active 设置为true。对于
tree_root
设置新AnimationNodeBlendTree
。然后为每个动画制作动画节点。通过混合节点将它们连接在一起(我使用0.5
进行混合值)。最后,我将在结束时添加一个搜索节点以控制它。AnimationTree
将为混合值和寻求值添加参数。将Seek参数设置为0将重新启动两个动画。只要动画不设置相同的变量,您就会具有理想的效果:两个动画播放。如果动画设置相同的变量,则将在两者之间进行插值,并由混合值控制。
You can use an
AnimationTree
.As usual, set the
AnimationPlayer
, and setactive
to true.For the
tree_root
set newAnimationNodeBlendTree
. Then make an Animation node for each of your animations. Connected them together via Blend nodes (I'd use0.5
for the blend value). And I'll add a Seek node at the end to control it.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.