Unreal Engine 5 RPG Tutorial Series - #3: Vaulting with Motion Warping
Summary
TLDR本教程是关于如何在Unreal Engine 5中创建一个角色的跳跃系统,并利用新特性“Motion Warping”来实现角色在跳跃过程中的平滑过渡。教程首先指导如何启用Motion Warping插件,然后导入并设置跳跃动画,接着创建一个动画蒙太奇并添加Motion Warping效果。之后,通过在第三人称角色蓝图中使用Sphere Trace来检测玩家前方的物体,并确定跳跃的起始点、中间点和落地点。最后,结合所有计算出的点,通过Motion Warping实现角色的跳跃动画,确保角色在跳跃过程中的动作流畅且符合物理规则。视频最后还提供了测试跳跃系统并调整参数的步骤,以确保系统的正确运作。
Takeaways
- 🚀 教程介绍了在Unreal Engine 5中创建角色越障(Vaulting)系统的方法,使用新特性Motion Warping来实现动作之间的平滑过渡。
- 🔍 首先需要启用Motion Warping插件,这可以通过编辑->插件来完成,并在重启编辑器后确认插件已启用。
- 📂 导入越障动画,这里使用的是Epic Games的Echo模板中的动画,它是免费且可用的。
- 💡 在资产详情中启用Room Motion特性,这允许动画在墙空间中进行变换。
- 🎬 将导入的动画转换成Animation Montage,这允许在蓝图中调用动画并在需要时添加Motion Warping效果。
- 🛠️ 在Animation Montage中添加Motion Warping,通过设置不同的状态来控制越障动作的起始、中间和结束阶段。
- 🔑 创建Third Person Character Blueprint,并在其中添加Motion Warping组件以及一个新的Vault函数。
- 🔄 使用Sphere Trace by Channel来检测玩家前方的对象,确定越障的起始点、中间点和落地点。
- 📐 通过计算和Branch节点确保越障的起始点、中间点和落地点都正确无误,以避免角色在越障时发生异常。
- 🏃♂️ 在越障过程中,设置角色的移动模式为飞行(Flying)并禁用碰撞,以避免与障碍物发生冲突。
- 🔄 应用Motion Warping,确保越障动作的起始、中间和落地点都设置正确,以实现流畅的动画效果。
- 🎲 最后,通过播放Animation Montage来执行越障动作,并在完成后将角色的移动模式设置回行走(Walking)并重新启用碰撞。
Q & A
在Unreal Engine 5中,如何启用Motion Warping插件?
-首先,打开Unreal Engine 5的编辑器,进入“编辑”菜单,选择“插件”,然后在搜索框中输入“Motion Warping”来找到并启用该插件。启用后,根据提示重启编辑器以完成插件的启用过程。
为什么在导入Vaulting动画时需要选择正确的Skeleton?
-选择正确的Skeleton(如SK_Mannequin)是因为Skeleton定义了动画的骨骼结构和层次,确保动画能够正确地应用到角色模型上。错误的Skeleton可能导致动画无法正确播放或者出现变形。
在设置Room Motion时,为什么需要将Reference Pose设置为禁用?
-在本教程中,禁用Reference Pose是为了避免在动画变换过程中使用一个参考姿态,这样可以确保动画的运动和变换更加流畅,并且能够根据实际的运动轨迹进行精确的调整。
如何将动画转换为Animation Montage?
-在内容浏览器中选择动画,右键点击并选择“创建动画蒙太奇”(Create Animation Montage)。之后可以为这个蒙太奇命名,并在打开的蒙太奇编辑器中进行编辑和添加效果,如Motion Warping。
在设置Motion Warping时,为什么需要指定不同的状态和时间段?
-指定不同的状态和时间段是为了控制Motion Warping在动画的不同阶段如何应用。例如,可以设置起始点、中间点和落地点的状态,以便在动画的特定部分应用Motion Warping,创造出更加自然和流畅的动作效果。
在Third Person Character Blueprint中,如何使用Sphere Trace by Channel来检测Vaulting的目标位置?
-通过创建一个Sphere Trace by Channel,可以从玩家的当前位置发射一个隐形的球体,并在一定的半径内检测碰撞。通过在不同的高度和位置进行Sphere Trace,可以确定Vaulting的起始点、中间点和落地点。
为什么在Vaulting系统的设计中需要考虑落地位置的高度范围?
-考虑落地位置的高度范围是为了防止角色Vaulting到不合理的高度,比如过高的墙壁或者地下,这可能会导致角色陷入地形或者无法正确执行Vaulting动作。通过设置一个合理的高度范围,可以确保Vaulting动作的自然和合理性。
在Third Person Character Blueprint中,如何确保角色在Vaulting过程中不会发生碰撞?
-在执行Vaulting动作时,可以通过禁用角色的碰撞(Set Actor Collision Enable Collision)来避免碰撞。这样可以确保角色在Vaulting过程中不会因为碰撞而中断动作。
为什么在应用Motion Warping之前需要检查Can Warp条件?
-检查Can Warp条件是为了确保所有的Vaulting点(起始点、中间点和落地点)都已经被正确地设置和检测到。如果没有中间点,角色可能会在Vaulting过程中发生异常,比如飞出去或者动作不连贯。
在测试Vaulting系统时,如何确保角色的动作看起来自然流畅?
-为了确保角色的动作自然流畅,需要在Animation Montage中正确设置Motion Warping的关键点,并且在Third Person Character Blueprint中精确控制角色的运动模式、碰撞状态和Motion Warping的触发时机。
如果在测试中发现Vaulting系统不工作或者动作不自然,应该如何调试?
-如果Vaulting系统不工作或者动作不自然,应该检查以下几个方面:确保Motion Warping插件已正确启用,检查Skeleton是否正确选择,验证Room Motion和Animation Montage的设置是否正确,检查Third Person Character Blueprint中的Vaulting逻辑和Motion Warping应用是否准确。此外,也可以通过增加调试信息,如在编辑器中显示额外的Trace线或者Sphere,来帮助定位问题。
Outlines
😀 启用虚幻引擎5的动态变形插件
本段介绍了如何在虚幻引擎5中启用动态变形插件,以便在RPG教程系列中创建一个平滑的过渡效果。首先,通过编辑->插件搜索并启用动态变形插件。启用后,需要重启编辑器。之后,导入来自Epic Games Echo模板的角色动画,并将其设置为具有动态变形的动画。
🎮 创建动画蒙太奇并添加动态变形效果
在第二段中,讲解了如何将导入的动画转换为动画蒙太奇,并在其中添加动态变形效果。详细说明了如何通过动画蒙太奇的编辑,添加不同的动态变形状态,包括跳跃的起始点、中间点和着陆点,并调整每个状态的持续时间。
🔍 使用球体追踪检测障碍物并计算跳跃点
第三段内容涉及使用球体追踪(Sphere Trace)来检测玩家前方的障碍物,并计算出跳跃的起始点、中间点和着陆点。通过循环和球体追踪,可以确定跳跃的路径和距离,并在蓝图中设置相应的逻辑。
📐 细化跳跃路径和计算着陆点
在第四段中,进一步细化了跳跃路径的计算,包括对跳跃路径上不同点的追踪和计算。通过设置不同的追踪点和调整追踪半径,确保玩家可以准确地跳到预定的位置。
🏃 角色蓝图设置和动态变形逻辑实现
第五段讲述了如何在第三人称角色蓝图中设置动态变形逻辑。包括设置角色的运动模式为飞行,禁用碰撞,以及通过动态变形组件添加或更新变形目标。
🎭 应用动态变形并测试跳跃动画
第六段内容展示了如何将所有的设置和计算应用于动态变形,并在蓝图中实现动画蒙太奇的播放。同时,还包括了对跳跃动画的测试,确保动画效果符合预期,并且角色在跳跃过程中的移动和着陆位置正确。
🚀 最终测试和观众互动
在最后一段中,进行了最终的测试,展示了角色使用动态变形进行跳跃的完整效果。同时,视频作者鼓励观众点赞、订阅频道,并提出希望在下一集中看到的内容。
Mindmap
Keywords
💡Unreal Engine
💡Motion Warping
💡Vaulting System
💡Animation Montage
💡Blueprint
💡Sphere Trace
💡RPG Tutorial Series
💡Interpolation
💡Asset Details
💡Third Person Character Blueprint
💡Custom Event
Highlights
介绍了如何在Unreal Engine 5中利用新的Vibes特性——运动变形(motion warping)来创建平滑的过渡效果。
展示了如何启用运动变形插件,并在重启编辑器后确认其已启用。
导入了Epic Games的Echo模板中的免费动画,用于角色的跃过动作。
讲解了如何将动画设置为具有变换的房间动画(room motion),这是实现跃过动作的关键步骤。
展示了如何将动画转换成动画蒙太奇(animation montage),以便在蓝图中调用和添加运动变形效果。
详细说明了如何在动画蒙太奇中添加运动变形,并通过关键帧控制变形的起始和结束。
解释了如何在第三人称角色蓝图中添加运动变形组件,并创建一个新的Vault函数。
介绍了如何使用球体追踪(sphere trace)来检测玩家前方的物体,为跃过动作提供必要的信息。
展示了如何通过循环和条件分支来确定跃过动作的起始点、中间点和落地点。
讲解了如何设置跃过动作的运动变形参数,包括忽略特定轴和禁用旋转,以实现更自然的动画效果。
讨论了如何通过设置角色的移动模式和碰撞状态来准备执行跃过动作。
展示了如何在蓝图中实现跃过动作的逻辑,包括检测物体、计算跳跃点和应用运动变形。
介绍了如何通过自定义事件来控制动画蒙太奇的播放,以及在动画完成后恢复角色的移动模式和碰撞状态。
讲解了如何确保跃过动作的落地点在合理的范围内,以避免角色陷入地下或其他不合理的位置。
展示了最终的跃过动作效果,并通过实际测试验证了运动变形和动画的平滑过渡。
鼓励观众点赞、订阅频道,并提供了加入Discord服务器以展示进度和提问的邀请。
预告了下一集将开始讲解刺杀系统和战斗感觉,激发观众对后续教程的期待。
Transcripts
what's up guys welcome to new unreview
engine 5 tutorial and today we are
continuing with the RPG tutorial series
we'll begin with the vaulting system and
we will take use of the new Unreal
Engine Vibes feature motion warping to
create a nice interpolation between the
Atari points it's going to be a very
easy build to follow so let's get
started
alright so the first thing
is basically enable the motion warping
plugin so let's go up here into edit go
to plugins and now we can search for
motion warping now you can see this uh
plug-in over here now it isn't better
but don't worry it is you know very
Advanced there's not any problem with it
I have experimented with a lot and we
want to make use of it so there's no
problem let's go ahead and take it and
then again a pop-up will show up there's
some better let's say yes and now this
uh other pop-up will appear and now it
will say that we have to restart the
editor let's go ahead and say restart
okay so once you have restarted the pro
of course if you didn't see the pop-up
you can use manually closer so let's go
ahead and just manually uh type in again
motion warping just to make sure that
indeed it is enabled okay so now we can
close this and now what we have to do is
go ahead and import the bouting
animation so again I have left it in the
description which is just an example
animation from the epic games Echo
template so it is completely free and
available but you know to make things
easier I have just left it in a simple
download so we're gonna go into
characters characters RPG character
animations and now we're going to do is
create a new folder we're just gonna be
voting okay
or parkour but I think Bolton is good so
later on we'll have different modes of
voting and jumping in and out of
different places right now we're gonna
do just one but later on we can add more
operations so we're going to do is just
open the folder and I'm gonna get the
Vault over animation which I have left
in the description and now we can just
go ahead and drag it into the content
browser and now this window will go
ahead and pop up so again just press
reset reset the default so the defaults
uh all the options are by default and
now we can go ahead and just select the
skeleton which in our case it will be
the SK mannequin again don't make the
mistake of choosing the old ue41 it was
the new ue51 just this simple SK
mannequin and now we can say import and
there we go we'll have a warning with
some bones and stuff don't worry
everything is fine we go ahead and open
the animation and we'll put it over here
you can see how cool it is looking so
yeah this is the vaulting animation
so the thing that we have to do over
here is go into the asset details now if
you don't see any of these windows you
can just go into windows and open it up
okay now what we have to do is go into
this room motion section and just enable
your room motion now room motion is an
animation that will have some transform
transformation in the wall space so this
will have a motion and it will move okay
we'll see how it looks in a second now
leave everything as default so reference
pose disabled for uh for root log and
then normalize ticked on and now we can
just go ahead and save and close it so
what we have to do now is go ahead and
convert this animation into an animation
montage
so an animation Montage like I mentioned
in the last episode it is just an
animation that we can call at any time
from the blueprint and we can add
effects such as motion warping so um we
can do so many things on so working this
is Select it right click or integrate
and then create anime montage and now
you can press enter and there we go we
can just open up and this will be like
the normal animation but now we can add
some things over here so we want to do
is go and add the emotion warping so we
want to do
is you start and find the start position
on the motion warping in right case this
keyframe over here around in the
timeline M5 looks pretty good so we're
gonna go into the section where we have
notifies and in the first track we're
going to do is place our cursor right on
top of the timeline right click go into
add notify state I'm going to go into
motion warping if you don't see motion
warping is that you didn't enable the
plugin quickly so let's go ahead and
enable motion warping now you can see
that we can drag it so what to do is
hold shift and I'll go into the last
keyframe over here and start dragging it
I want to drag it until around
maybe 18 okay pretty much nearly 18 like
17 over here
so basically the notify States will be
basically used for duration and I notify
normal notify will be for example play
sound which will be just one frame so
what we want to do is basically just
apply the motion warping during this
timeline over here now what I want to do
is go ahead and have another motion
warping so we will have three different
states okay because we'll have the
starting point where we jump into it
then the
um basically the middle point when we
are basically going
and landing and jumping again and then
the final Landing one okay
so what we have to do is to make things
a bit cleaner and don't have like things
going on top of each other what we can
do is go into notifies and here just
place at notified track and this will
create another track so now in the
bottom one we can just add another
motion warping uh not if I stay so what
to do is go around into 26 over here
okay there this doesn't need to be exact
okay this is an approximation now you
can later on tune in a bit better the
motion warping I'm gonna place the
cursor on top I'm going to uh notify
State and again motion warping now
holding shift we can see that we can go
and drag the animation so this will be
around a bit more than 40 so around 40
41 there we go so this will be the
basically the middle point of the motion
warping and now we will add another
motion warp in the last one which will
be the landing point so we want to do is
go around here so basically do it before
like 37 something like that and we want
to go up in the other track so we have
space this is what I mentioned before of
overlapping now we just want to add
another motion warping and then hold
shift and then move it into this final
uh press over here so I guess we could
add it into 50. okay so now we have a
bunch of warping and you know in the
preview it will not change anything but
now what we have to do is Select this uh
first motion warping and if we go into
the details panel that if you don't see
it again you can go into windows and
details we can start changing the uh the
options so we want to do is first of all
make sure that the room motion modifier
it is on skew warp okay and now we need
to set our name so in our case this will
be the about
start
okay the beginning of the belting and
now what we want to do is just ignore
the said axis in this first warping
because we don't want to be
um affected by the set axis okay now
we're gonna go answer that the second
um motion warping
and again skew warp and the name this
time will be the middle
middle
I think I put a vault in the other one
first yeah well start about the middle
and now this time we want to have the
ignorance head access on top but we want
to disable warp rotation
and we want to go into the last one and
this will be the valve
land I don't know if I'm saying both
about I don't know I'm Spanish I don't
know how really how you spell it but
hopefully it doesn't annoy you okay and
now we want to do in this last one is
disable work rotation and in North
z-axis so we will only have the
translation great so now we have our
um motion warping in an animation
Montage set up so now we can go ahead
and save and close it so Ctrl shift s to
save everything
so now let's go ahead and open the third
person character blueprint let's go to
third person Blueprints and open the
third person character
Grace go into the van graph and you can
save what we did in last episode which
was the crouching step which actually we
can do is Select everything and press C
so we can have a nice comment
let's go ahead and play Just Crouch
and to have things a bit more organized
and looking better I'm going to select
the other comment and I'm gonna go and
open the common color and select the
Hexum color copy it and then in the
other comment that I have used basically
just pieces now it looks pretty much
exactly the same great
so the first thing I have to do is go
ahead and add the motion warping
component so we're gonna go ahead and
going to add motion
warping and I will just press enter and
we don't have to touch anything
so now what we have to do is go ahead
and create a new function
let's go in here function and this will
be basically Vault or however is spelled
great so here we go we are starting with
the actual system of the boat I'm
basically here we're going to calculate
all the different points that we have to
go
so the first thing that we have to do is
basically make a fourth Loop for Loop
would break okay so not the
um for Loop
with the array okay we want to have a
begin and last index so I had a bit of
trouble to find it but here it is and
the last index will be two so basically
we want to do three line traces so I'll
explain in a second what a line Trace is
but what we want to do is actually a
sphere Trace by channel so I just said
line Trace Spirit traces basically the
same but instead of being online it's
just a whole sphere okay so we want to
create a spirit Race by Channel
and this will basically be an invisible
sphere that will appear in a certain
location and with a certain radius and
stuff that it will detect some objects
so in our case we will start detecting
the objects that we want to bolt and
stuff okay so what we want to do is go
ahead and get the actor location okay so
we want to start our Trace from where
the player is at what we want to do now
is go ahead and add
I want to go ahead and right click and
split so we have all the individual
access over here and basically what we
want to do is put this a bit to the
right and we want to get the index of
our Loop and we want to go ahead and add
here time this by 30.
so basically we'll be creating three
different line traces with a an offset
of 30. so basically a bit separated from
each other so that will be the Z value
over here okay
put this over here there we go
and this will be our starting point
so really if I go now and compile and
save and I write you so it's gonna be
around five it's gonna be kind of a bit
thin and then I say in this bug type for
duration
and then we go into the van graph and we
go and say for example when we press
left shift
okay we will call vault
let's see what this happens over here
over a press play
and press Vault you will see that we
have uh basically three sphere traces I
say line traces but you get by Point s
for your choices going uh from a 30
30 of separation from each other into
the into the point
so in here what we'll do is basically
just point them uh in front of us and
check the objects that are basically in
front of us okay so this is the idea so
let's go into both
sorry about the golfing guys and we want
to
um basically set an ending point because
if not they will go into the zero zero
zero and we don't want that okay we want
to have them just in front of us so we
want to do is get the actor rotation and
want to do is basically get the forward
Vector so basically where the character
is right now looking and we want to go
ahead and multiply this right click
convert to a float
by the distance so how much we want to
detect the objects so for example we'll
just put like 180 right now
and now we want to do is get this
um pane over here and basically add
these two vectors together and this will
give us our end point so now if we
compile and Save
and press play you will see that now
when I vault
now we have the different sphere traces
just in front of me instead of going to
this ratio great so everything is
working pretty good and pretty fine
so now we can go ahead and continue
so now we want to do is go and check
with a branch that we have actually
headed something and if so we want to go
ahead and break the Heat result so we
have all the different parameters about
the object that we have just hit by the
location and so and so on
so if we have hit something we want to
immediately break this Loop over here
so we're going to just get the
uh make actually yeah we can just get
the true rugged I'm going to break and
what we can do to make things more
organized is just double click and then
make a pin okay and then double click
and make another ping and we can drag
this one over here
okay so since we have detected something
we don't need to make more sphere traces
because we have the height so we can go
ahead and stop the loop okay if it makes
sense
so
um this is very good explained if we for
example go in here and I just get for
example this actually let me adjust a
cube
okay and then bring it here
and then I use make a bit like this I'm
up so you will see that
it will only make one line Trace because
it only calculated once now if I make it
a bit up over here
now it will do two line Trace until it
touches the object you know and now they
will do the three so you get that point
basically okay
so what we want to do now
is drag this and make a sequence because
we will have one more thing
so there you go and what we will do
is go and make another loop so again for
each loop with break not with array
I know sorry that the problem is that
I'm writing for
um each and it's not it's just support a
little bit breaks that was a prawn I
have this
um thing where I always used for each
looks with the braid that's why
okay so this time the last index will be
around let's say five
so we'll have six different traces and
the thing that we have to do right now
is go ahead and make another sphere
Trace by chance so we can just copy our
previous one paste it and now each time
we'll go ahead and make a Trace
great so what we want to do now is
basically get the location where we have
hit
and add
basically
90 or whoa 100 basically in a height so
you will see how this goes okay but now
what we want to do is again get the
index and do the same thing that we did
before okay but this time with around
50.
so we want to go ahead and have
different Lane traces with a 50 a
separation between them
so we want to do now is go ahead and add
all right let's make it here great we
can
put them here okay
and we want to do is basically add the
get actor rotation
and get full Vector so we'll again want
to get the the forward of the player and
we want to multiply this
by this separation over here and now we
can go ahead and add this so there's a
lot of connectors over here maybe it's a
bit confusing but
um you will see how it looks in a second
so probably it will clear up your mind a
bit better another thing that we have to
do
is plug it to the start so you will see
that now
uh when I press play let's say yeah we
go here
and it will create some line traces
right up following the path and with a
50th separation great now the thing is
that we have to set the endpoint if not
we'll go against here so what we can do
is get this point and just subtract like
thousand
um into the end point
sorry not a thousand only a hundred
because we don't have we don't want to
basically allow our player to vote into
like 50 meters down only a few meters
um so this is great
so now when I Collide you can see the
line trades now going into a row forward
but downwards so basically on here we
will see the distance that we have to
Vault so basically if I make this per
system
and I can just show you a bit how it
looks so I can just go here so first of
all we'll go ahead and make a line Trace
uh in the in like forwards seeing okay
which height do we have to go ahead and
vote great and now we will see
well
um
which distance we have to to go ahead
and bolt so you can see the here is
colliding here's colliding here's
collating but here is not calling so
when we check that it is no longer
collided we can see the okay now in here
it is where we're gonna go ahead and
vote because the object has finished so
now we can go ahead and end over here so
this is why we're doing this okay great
so now that we have uh cleared a bit
this things over here we can go ahead
and continue so now with the radius I
will go ahead and increase this one into
10 and put this back to for duration
okay so now we want to do is again make
a branch to check if we have headed
something and then break the hit result
okay so we'll contain all the parameters
once again
great so what we want to do now is make
another sequence over here okay and
we'll basically just
uh continue making some more right casts
and seeing where we have to end and so
on
okay so
all we have to do now is make a branch
and basically what we have to do is get
this index over here and check if it's
the first Pawn so we want to do now is
get this making a equal sign in this
case it will be a an integer which I
don't see it but I think I can just use
this get the index and plug it in
there we go and now we can double click
to make it root so it's a bit uh cleaner
as you can see
great so if the rate that we have
basically hit it it is the first index
the first one we want to do is go ahead
and create a new variable which will be
the
um vote start pause
and now we want to change this into be a
vector so this will be our position
where we will start voting so now we can
go ahead and get this and set it with
this specific uh location here so we
want to go ahead and drag it here now we
can double click and drag here so it's a
bit more organized once again and now
what we can do to basically uh preview
this and just get this and then draw a
sphere the bug sphere
and now we can go ahead and just put a
10. a duration of 10.
and the thickness of two for example and
this to be purple
so now we will see
where we want to start now I will go
ahead and get rid of this because not
really good example
and I will for example get this okay
over here I will just duplicate it you
can do the same just duplicate that
sphere over there Ctrl d
the cube not sphere and then we can use
the the r or the tool here to rescale it
and we can make it uh way smaller so
basically kind of like this maybe it's
good
um so you can change the values over
here in the scale directly and now you
can see there we go you can see this
point this is where the vaulting will
start the motion warping so where it
will go basically towards
so you can see how it's going over there
great now in the sequence uh so you have
if it doesn't do anything we don't want
to do anything okay it's not the first
point we don't want to do anything we
only want to get the first point now
what we want to do is in the sequence is
get the basically the the distance Point
okay so let's go and get this and this
actually the Middle Point okay it's
actually the middle point so about
middle pass and again it's going to be a
vector now a thing that I'm going to do
is go ahead and create a how was it
let's go and create a category so it is
a bit more organized okay so you can see
we have categories over here so let's do
the same so what we can do is go into a
wizard uh category here so we need to
select the variable going to Catherine a
normal downgrade categories okay but now
we can change the name and this will be
into Vault uh yeah vote and I will do
the same with this one but now we can
select it great so now it's a bit more
organized later on when this player
starts growing and stuff and actually
later on if we want if we see that it's
a big chunk we can move it into a
separate component but I think honestly
because we have it tidy we can for now
keep it like this okay so yes so now we
want to get the volt middle pass it's
basically the distance that we have to
basically
um bout
vote however you spell it and now we
want to double click here and then we
can use the same pin and now we can
connect it so now this will be the
destiny post kind of and now we can
again copy this and paste it and draw
another uh debug post and actually I'm
gonna get these points I'm over here so
it's a bit more organized and this time
let's say that's going to be yellow okay
and then we need to pass this location
so now Ctrl shift s guys to save
everything to know it just in case it
crashes or whatever okay and now if I
vote you can see
the separate points so he collected
quality collected and no so what I was
saying before so this is the depth so
here it will start then it will go into
here into the middle point and then
later on we'll get the landing position
great so what we want to do now is go
ahead and
um
yeah continue with the branch so if we
have not hidden anything that means that
we are in that landing position like can
you show you now okay so this time we
want to do a normal line Trace by Chain
there's no necessity of dominant Spear
and now we can double click and put this
here so it's a bit more organized more
clean
and basically this Trace start will be
the starting point of the last Trace so
if I Vault you will see that the last
race was the one that didn't hit
anything so we want to get a starting
point in that and we want to add an
option to this okay so the offset of
this sorry about the coughing uh guy
over here will be again we get actor
rotation
I don't know how to spell rotation my
goodness totation no rotation there we
go and we want to again get the four
vectors we want to basically get what
are the characters looking
and what we want to do is multiply this
and it's going to be the distance this
is going to be basically the distance
that we will land so right click convert
into a float
and let's set it to let's say around 80.
okay and now this will be the position
so we'll get the trade start but with an
offset of 80 forward so that's a landing
position how many times I have said
Landing I don't know anyway this will be
his starting point and now our end point
will be basically this but subtracting
and just downwards in our case this will
be a thousand so we want to basically
this line Trace until we touch the
ground okay great another we want to do
is basically make a branch
okay and then again our head we need to
break it so we get all the parameters
and we need to get the location right
click promote variable and now this will
be the vault
land pause I'm gonna go ahead and answer
it into vault in the category and now in
true we can plug it in
and great this will be the bolt land
plus and now what we want to do is
basically break the loop because we
don't want to continue making more right
gas so we need to make a massive
a massive Arrow here so let's see uh so
we can just go ahead and get it and I
think that we can just do is just say
add a rewrote node and now I can just
put this here
and I'll drag it and now here at uh
route we wrote I don't know how it's
spelled
this node and then here we can just drag
it and plug it into the brake
and it did break the loop great okay
wait it's not plugging in okay uh don't
worry let's just plug it into break okay
I don't know why it wasn't let me okay
double click and it will let you okay
weird things anyway you can just drag it
and there we go
so yeah basically we just have to go and
stop the loop over here okay and we have
to do this routing but it is what it is
because it is a um
basically it's a function and if not we
could just create a custom event and
call it here but hey
it is what it is
so now we can just compile and Save so
we go ahead and check this over here
you can see
that we have a line Trace appearing
which you guys cannot see here because
we don't have it in for duration
and let's put the trace color to be
let's say
um green okay
actually not green now because it's the
hit color so
blue let's say blue
so now if we go here and Trace you can
see this uh Trace over here so this will
be the landing position
cool so in here basically we will lamp
great so I believe that I don't miss
um anything
so I guess we can just continue
great so what we're going to do now is
basically just
um
uh basically start making the room
motion so we have all the positions set
up so we can go ahead and Trace we have
the starting point the middle point and
the landing end point so we have all the
details that we need in order to pass to
our animation montage and the water
motion warping
great so let's go ahead and start
applying all that so what we're going to
do is go into the third person character
blueprint and what we can do now is
sorry about the coughing again my
goodness okay and now create another uh
function which will be the Vault
um motion
Warp great so what we're going to do in
here is basically double check that we
can Warp
and why what would you see thank God
that I already did all this system in
another pride and experiment with it
because there's a lot of things that can
go wrong in this calculations that we
did okay
so what we're going to do is go ahead
and right click promote variable and
create a new
um node which is can work
okay so there we go
so it kind of work okay
so if it's true we're going to do is
continue now where do we set this can
warp like where do we do it well of
course we're going to go into Vault and
we're going to go in here so if we get a
middle pass
you will say okay we can work and why
are we doing this thing here in the
middle position it doesn't really make
sense the thing is that
sometimes the line tracers do not uh
collide with each other correctly or
follow the sequence correctly and they
miss sometimes the middle pass so we're
going to do is say hey if you don't have
a middle position you cannot warp and
the thing is that if you don't have a
middle position but you work
if you you fly the character explodes it
it is very weird so we want to make sure
that we get a middle position so this is
more like a patch okay but
um but yes basically just making sure
that we have all the correct positions
so we can Warp
okay so now we can go back into our uh
voting motion warping and we can
basically start making the
um
the the motion warping and stuff but the
first thing I want to do is go and get
the character Moon component and set the
movement mode
and here when it's true of course to be
flying so we will not be able to have no
more
um movement but we'll be in flying great
so now another thing to do is set actor
Collision
enable Collision to be false because
with my testing sometimes the actor
collided with the obstacle and then it
it just
yeah it just destroyed everything okay
so we want to make sure that the
collisions are disabled and now what we
can do is finally get emotion warping
and what we want to do is say add or
update
warp Target so this will be basically
the Target and now we want to do is just
get the settings right click and split
it so now we have all these settings
so now we want to set up the name so in
our first let's start with the Vault
start position
let's go ahead and go into the
characters RPG character animations
bouting and the vaulting montage and now
we want to go ahead and select the first
montage and we want to put exactly the
same name now if you remember you can
just plug it in but I do recommend going
selecting it copying it and then going
back here and then paste on it okay it
has to be exactly the same if there's a
character missing or a a um I think it's
also case sensitive so the vault is in
lowercase or as space at the end it all
messes up so it has to be exact that's
why I recommend going coping and
business and now the location will be
basically about starting position
so there you go plug it in there we go
pretty pretty cool now the warp Target
rotation will just be the get actor
rotation so the rotation basically of
the
voting will be exactly the same we will
not touch anything and now the last two
settings we don't have to touch them and
that will do exactly the same so copy
these three notes except for the
position paste it
and I will do the same but with the
middle one so let's go ahead and plug it
and we need to go into the Montage
select the second motion warping
copy the name go in here and paste it
make sure there's no any spaces at the
end or whatever okay guys and now we
want to do the same
I want to get this three notes
paste them
and then the end is going to be the land
position and I'm gonna plug this in and
now again we're gonna go into the
Montage go into the last
um motion warp copy the name and we're
gonna go into the third person
blueprint and paste it great compile and
shape so now we are setting this
positions which basically will allow us
to make the motion warping towards
um that places so now it comes the best
part which is going ahead and playing
the Montage so if it's not uh play any
montage
uh we are gonna get the advanced one
because it gave us more options so we
can just get the play montage
oh yeah so ah this is so bad so I just
forgot in functions we can we can't go
ahead and place any delays
or any other time
um
any other note that basically changes
the sequence of time so this is just
done pretty much
on one frame so the thing is that they
play Montage note that I wasn't gonna
say
contains an uncompleted output so
instead of in the same frame we can just
get when the animation would have
finished but the thing is that well that
basically changed the sequence of the
how this runs so we cannot use it on the
function
so what I'm going to do is go into this
I'm gonna go ahead and copy everything
and then accept the first note Ctrl X
and I'm gonna go into the event graph
and then create a new custom event so
say add custom end it's going to be uh
it was a world
motion Warp
ah it doesn't let me because it's the
same name I just put two and paste it
and I will change the name okay
so plug it in okay select this node we
can press C to comment it this is going
to be the fault motion Warp
and now we can just plug this in here
and then we need to go ahead and get the
Vault motion warp which doesn't contain
anything and delete it okay press uh
super mirror or delete I don't know how
it's in English and I can go into the
bank graph and change the name into
about motion Warp
great so now we can indeed go here and
say get the mesh
and say play Montage if I know how to
split it
there you go play montage
so we need to plug in the mesh
and now we need to select the asset
which will be the bolt over that we have
just created before and now in on
complete we can go ahead and set back
the character Moon component
set movement mode to walking
and all that you see stuff we can set
the actor Collision back on so take it
and then we can go ahead and what we're
going to do he's getting kind of warped
and I set it to false
explain one in a second and then we're
gonna get the land uh position
I'm gonna set it
and then the Z will be around 20
000. we're gonna say why what just
happened here why are you doing this at
the end let me just explain it in a
second but first of all let's go ahead
and we have to do one last check over
here and also we have to call this
motion warp so we're gonna go into the
vault
okay
and the thing is that here
um we have to call the motion warp so
basically
sorry not here at the end okay it's not
at the end it's actually at the second
trace on the uncomplete so why are we
doing it on the second Trace instead of
the end well this is because on this
last race we are breaking this Loop so
when this is completed basically
everything all the calculations have
finished so in this completion we can
call the um
about motion warp okay actually we can
just put it over here great so this is
what it will trigger there
cool so now we can compound say
now it will call but we have to make one
more change with the ambient we have to
do is basically get this and get the
land position
we're gonna get I'm gonna right click
and split so we have all the access I'm
gonna check that the set is in range
that float and now we want to get the
return value and and
then plug it in here and then the
canvarp here into this node and here so
basically this two
nodes have to be uh true in order to to
proceed
so basically the main value will be the
mesh
it's vault location
I'm gonna split it I'm gonna set and I'm
gonna basically in this one subtract it
so the minimum will be minus 50.
and plug it in and the other one will be
plus
50.
so basically
we need to also put this here it's a
little bit better there we go put this
here great
and we'll take the two so it is also
including the 50 and 50. great so what
is this doing well basically the things
that sometimes uh the landing position
might be
basically on top of the player's head
far away up and in that case we don't
want to motion work okay we only want to
motion warp if basically the
the the the thing the landing position
is in between that range of the place
position in the set minus 50. so
basically the kind of in this point over
here not on here or on here you know
what I mean so this will prevent us from
climbing this wall uh at once and then
finishing underground okay basically
it's just checking that okay and then
what I did here was basically it sent up
to 2000 at the end of the of the
completion why well again basically if
we go into any
uh
while that is up the landing position
will not basically get updated
this because the calculations will not
get into here so the alignment Position
will not but yes the starting and the
Middle Point sometimes so it will
basically not update the landing
position and it will get the last one so
let's say that we just jumped over here
the wall that we had over here which it
is unloaded we just want to reload the
scene
sometimes the open world map is
basically unlocks things okay so imagine
that we bought this okay and we have set
the variable of the landing position to
whatever height over here
so now if we go on both this maybe the
we get the first point which is on the
starting point at the middle point but
not the end point
so basically if that value is still
there of the landing position we will
basically jump and until Port into this
blending position
but because we said it with this range
calculation here and then this massive
number it will say hey it is out of
bounds we don't want to jump over here
so we'll prevent it okay it is extremely
confusing maybe now I don't know how to
really explain it so you can visualize
it but it's basically just a quick way
of just making sure that everything is
on
um
on the great values okay
great so it is time to test it out
finally so much time waiting for this
moment you know press play
experience in this bowl we can go
towards it we can press shift and there
we go you can see how cool it looks
let's do it again wow that looks
absolutely amazing guys look at this
yes so motion warping working so yeah it
looks absolutely incredible guys so look
what I was saying if I jump here it will
not let us and
basically you're maybe insane okay what
if we want to jump there well we would
use another both system later on the
thing is that you can see that this boat
goes from up to down and the thing as
here is that this place goes uh this
mesh over here goes just up and then
finishes here so if our animation was
keep going it will need to go down again
but it will trespass so that's why we
did all that calculation so we cannot go
now in the future we will add more
voting animation setup so we will
include one that will only jump here
okay great guys so if you found it so
helpful I would really appreciate if you
could like the video and subscribe to my
channel I have lots of Unreal Engine 5
tutorials so this one so if you want to
go ahead check them out also see the
full playlist until now of the RPG
series and delete the comment below of
some things I want to see probably next
episode we'll start with the
assassinations and start with the combat
feeling and stuff so I'm very excited
now if you want to see first before that
the source control tutorial I can go
ahead and
make it so we can basically just set the
source control so leave me your comment
what you think in the description anyway
go ahead and join the Disco server so
you can show your progress and ask any
questions and now yes with all that says
subscribe and like the video and what I
said bye bye
[Music]
関連動画をさらに表示
Unreal Engine 5 RPG Tutorial Series - #9: Combat
Unreal Engine 5 RPG Tutorial Series - #2: Locomotion - Blendspace, Crouching and Procedural Leaning!
Unreal Engine 5 RPG Tutorial Series - #4: Assassinations
Unreal Engine 5 RPG Tutorial Series - #12: Target Lock and Dodge Roll
Unreal Engine 5 RPG Tutorial Series - #14: Equipment System
Ninja Input - 01 - Installation and Overview
5.0 / 5 (0 votes)