Unreal Engine 5 RPG Tutorial Series - #2: Locomotion - Blendspace, Crouching and Procedural Leaning!
Summary
TLDR在这段视频教程中,我们开始了一个新的虚幻引擎5 RPG教程系列。主讲人非常兴奋地介绍了基础的移动系统,包括设置动画蓝图、程序倾斜、以及创建两个状态:站立和蹲伏。通过添加停止动画,让角色的移动更加流畅和生动。视频中还提到了未来将添加的更高级的移动元素,如攀爬等。教程使用了虚幻引擎5.1.1版本,并推荐使用最新版本。创建了一个新项目,并导入了必要的动画,然后详细讲解了如何创建一维混合空间来根据角色速度平滑过渡不同的行走和跑步动画。此外,还介绍了如何创建状态机来管理角色的不同动画状态,并如何将这些动画应用到第三人称角色蓝图中。最后,视频还涉及了如何添加倾斜和跳跃动画,以及如何改进角色的倾斜动作,使其在转向时更加自然和流畅。整个教程内容丰富,适合希望在虚幻引擎5中创建RPG游戏角色移动系统的初学者和中级开发者。
Takeaways
- 🎮 教程介绍了如何在Unreal Engine 5中创建一个RPG游戏的基础运动系统。
- 🚀 开始时,创建了一个新的Unreal Engine项目,并使用了第三人称模板作为RPG游戏的起点。
- 💡 使用了动画蓝图和状态机来控制角色的不同运动状态,如站立、蹲伏和跳跃。
- 🌟 通过创建混合空间(Blend Spaces)来动态地根据角色速度变化调整动画。
- 🏃♂️ 实现了角色的基础运动,包括行走、跑步和停止,并添加了停止动画以提高流畅性。
- 🧍♂️ 为蹲伏状态设置了单独的动画和状态,使角色运动更加真实。
- 🔄 利用状态机有效管理了角色的不同运动状态和过渡。
- 🎭 通过动画蓝图实现了角色倾斜(Leaning)的效果,增加了角色运动的自然性和动态感。
- 📁 强调了定期保存工作的重要性,以避免数据丢失或崩溃。
- 🔍 提供了如何导入和使用Epic Games提供的免费动画资源。
- 🔄 展示了如何通过设置布尔值和输入动作来控制角色的蹲伏状态。
- 🎨 最后,还提到了如何为角色自定义材质和颜色,以创建独特的视觉外观。
Q & A
在Unreal Engine 5中创建新项目的推荐版本是什么?
-推荐使用最新版本Unreal Engine 5.1.1,因为这是最新发布的版本,可能会包含一些重要的更新和改进。
在RPG游戏中,创建角色动画时,为什么要使用Blend Spaces?
-Blend Spaces允许开发者根据不同的输入值(如角色速度)平滑地过渡不同的动画,从而创建出更自然和流畅的动画效果。
在动画蓝图中,如何实现角色从站立到蹲下的过渡动画?
-通过创建一个布尔类型的变量`isCrouched`,并在第三人称角色蓝图中设置输入动作来控制这个变量,从而触发从站立到蹲下的过渡。
在Unreal Engine中,如何实现角色的倾斜(Leaning)动画?
-通过创建倾斜的动画并将其设置为可叠加(additive)动画,然后在动画蓝图中使用`Apply Additive`节点来将倾斜动画叠加到现有的移动动画上。
在设置角色动画时,如何调整角色的最大行走速度?
-在第三人称角色蓝图中,找到并修改`Max Walk Speed`的值来调整角色的最大行走速度。
在动画蓝图中,如何实现角色的跳跃和下落动画?
-通过创建一个新的状态机来管理跳跃和下落的动画状态,并在状态机中设置相应的过渡条件,如速度向量的大小和方向。
为什么在创建RPG游戏时,推荐使用第三人称模板?
-第三人称模板提供了一个很好的起点,因为它包含了许多适用于RPG游戏的预设功能和组件,如角色控制器和摄像机设置。
在Unreal Engine中,如何实现角色动画的缓存以优化性能?
-使用状态机(state machine)来缓存动画,这样可以减少运行时的内存占用和处理需求,通过将多个动画状态组织在单个节点中来实现。
在RPG游戏开发中,为什么需要设置角色的停止动画?
-设置停止动画可以使角色的动作更加流畅和逼真,避免从行走或跑步状态突然停止时出现不自然的过渡。
如何通过动画蓝图来控制角色的倾斜动画的强度?
-通过计算角色的`Delta Rotation`(旋转差值)并使用一个乘以特定强度值(如10)的因子来控制倾斜动画的强度。
在Unreal Engine中,如何实现角色从正常行走到蹲行的平滑过渡?
-通过在动画蓝图中创建一个新的蹲行状态机,并且使用布尔变量`isCrouched`来控制角色是否处于蹲行状态,从而实现平滑过渡。
Outlines
😀 开始 Unreal Engine 5 RPG 教程系列
本段介绍了一个全新的 Unreal Engine 5 RPG 教程系列的开始。讲解者非常兴奋地介绍了将要学习的内容,包括基础的移动方式、设置动画蓝图、程序化倾斜等。计划创建两个状态:站立和蹲伏,以开始感受角色的移动,并添加停止动画以增强效果。提到视频可能会比较长,因为想要在第一个视频中完成移动方面的教学。
🚀 创建新项目并导入动画
讲解者指导观众创建一个新的 Unreal Engine 项目,并推荐使用最新版本的 Unreal Engine 5.1.1。选择第三人称模板作为 RPG 游戏的起点,并确保选择了蓝图选项。接着,讲解者介绍了如何导入所需的基本移动动画,并展示了如何在内容浏览器中设置和组织这些动画。
🔍 创建动画蓝图和状态机
本段讲解了如何创建一个新的动画蓝图,设置状态机,并为角色的静止和移动状态创建不同的状态。详细说明了如何将动画拖入状态机中,并根据角色的速度动态改变动画。还介绍了如何创建一个停止动画状态,以及如何设置状态之间的转换条件。
🎮 第三人称角色蓝图和速度设置
讲解者展示了如何进入第三人称角色蓝图,并设置角色的动画类以使用新创建的动画蓝图。介绍了如何获取角色的速度,并将其与动画蓝图中的变量关联,以便根据玩家的实际速度动态播放动画。
🦵 添加跳跃和下落动画
本段介绍了如何为角色添加跳跃和下落的动画。讲解者展示了如何创建新的动画状态,并将其与相应的动画关联。还介绍了如何使用变量来控制角色是否正在下落,并根据速度变化来切换不同的动画。
🔧 优化动画蓝图和实现蹲伏
讲解者对动画蓝图进行了一些优化,使其更加整洁,并开始实现角色的蹲伏功能。介绍了如何创建一个新的状态机来处理蹲伏状态,并设置蹲伏和站立之间的过渡。
🧍 实现角色蹲伏的输入和动画
本段讲解了如何在第三人称角色蓝图中实现蹲伏的输入动作,并将其与动画蓝图中的蹲伏状态关联。介绍了如何设置输入映射,以便玩家可以使用特定的键来控制角色的蹲伏动作。
💪 添加倾斜动画和调整角色外观
讲解者展示了如何为角色添加倾斜动画,以使角色在转弯时更加自然和流畅。此外,还介绍了如何改变角色的外观,包括颜色和材质,以创建一个更加独特的角色形象。
🔄 调整动画细节和角色材质
本段继续调整动画细节,确保跳跃和下落动画能够正确播放。同时,讲解者还展示了如何为角色的材质设置特定的颜色值,以完成角色外观的自定义。
🎨 完成角色外观设置并总结
讲解者完成了角色外观的设置,确保了角色的蹲伏、倾斜和移动动画看起来非常出色。最后,讲解者总结了整个教程的内容,并鼓励观众为视频点赞和订阅频道,以便跟进接下来的 RPG 系列教程。
Mindmap
Keywords
💡虚幻引擎5(Unreal Engine 5)
💡角色动画(Character Animation)
💡蓝图(Blueprint)
💡动画蓝图(Animation Blueprint)
💡状态机(State Machine)
💡混合空间(Blend Space)
💡程序化倾斜(Procedural Leaning)
💡下蹲(Crouch)
💡源代码控制(Source Control)
💡第三人称模板(Third Person Template)
Highlights
开始新的Unreal Engine 5 RPG教程系列,非常激动
从基础的移动系统开始,设置动画蓝图和程序化倾斜
创建两个状态:站立和蹲伏,以开始感受角色的移动
添加停止动画以增加流畅性
使用最新版本的Unreal Engine 5.1.1进行项目创建
使用第三人称模板作为RPG游戏的良好起点
导入Lyra模板的基本移动动画
创建新的动画蓝图和状态机来控制角色的移动
设置基于角色速度的动画混合空间
实现角色的跳跃和下落动画
通过状态机实现从站立到蹲伏的过渡
调整最大步行速度以匹配蹲伏动画
实现角色倾斜以增加移动的真实感
使用时间轴平滑相机的缩放以匹配蹲伏动作
创建倾斜的动画蓝图并应用倾斜效果
通过角色的旋转和倾斜增量实现程序化倾斜
更改角色材质以匹配特定的视觉效果
教程结束时鼓励观众喜欢、订阅并关注RPG系列的进展
Transcripts
what's up guys welcome to new Unreal
Engine 5 tutorial today we are starting
with the RPG tutorial series I am very
very excited we will begin with the base
of The Locomotion and we will start
setting up the blend spaces animation
blueprint procedural leaning and more we
will set up two states an art and Crouch
so we can start to get the feel of the
character's movement and we can add a
stop animation to make it more food and
procedural leaning as I mentioned before
to make it feel more Vivid this video
might be a bit longer than expected or
compared to others but I wanted to get
this Locomotion aspects done in this
first video this is only the start of
the core elements of The Locomotion
system so with time we will add the
Assassin squid or core elements such as
vaulting Etc it's going to be a very
easy build to follow so let's get
started
all right so let's create a new UE
project I will be using the latest
version of Unreal Engine
5.1.1 and I do recommend that you use
the latest version 2 or at least my one
if you are still in UE 5.0 it should
still be okay but always try to use the
latest one which again I will be using
5.1.1 which actually just released a few
days ago so we're going to be using the
third person template as it is a great
starting point for a RPG game we'll be
using only blueprints so make sure that
blueprints is selected now the other
options you can customize this as we go
I will be using desktop maximum sorry
content and Ray tracing off but you can
change this later on so it doesn't
really matter go ahead and choose the
file location for your part and then we
can put a name in my case let's do for
example RPG
um underscore tutorial
series
and as we cannot put any spaces we need
to put underscores and that's pretty
much it again make sure blueprint is
selected and third person and your you
know good location and the name and now
we can go ahead and click create alright
so project created so let's get started
by importing the animations that I have
left in the description there is some
basic Locomotion animations from lyrex
template so they're completely free and
available from epic games but because it
is too much of a fossil to you know
create a Lyra pride and import them one
by one and it will you know fill up a
lot of your space on this on your
computer what I did was just export the
ones that we need and left them in the
description so let's go ahead and load
them and now we can go ahead and import
them so
we're going to do is go into the
characters folder and then we're gonna
do is create a new folder this will be
RPG
underscore character
when we have a proper name for a
character if you want to we can later on
change the name let's go ahead and enter
and now we want to create a new folder
for this animations
let's go ahead and enter and now let's
go ahead and open the folder so I don't
know if I would have made a zip but if
so just unzip them now select all of
them and just drag them into the content
browser so now this window will pop up
so first of all let's go up here and
reset them to default so we have all
these settings like normal
so we have to go ahead and select
skeleton in our case it will be the SK
mannequin the normal ue5 mannequin now
don't make the mistake of going ahead
selecting the alt ue4 one we want to
just get the normal uh SK mannequin and
now we can go ahead and just say import
o and now with some seconds all the
animations should be in our content
browser in our product and we can start
creating the blend spaces and stuff and
there we go count of shift s to save
everything and now you will see that
we have the animations really cool so
basically what we're going to do is
create a new folder and it's going to be
a locomotion
so in our case for now what we're going
to do is also use the template default
animations so in our case for The
Locomotion animations there's only two
new over here which are idle break and
unbox top so let's go ahead and drag
them and move them here
now I'm gonna create a new folder it's
going to be crouched and now we want to
select these two folders and so I
animations I moved them into the folder
let's go ahead and enter into Locomotion
and what we want to do is start creating
the animation Blank Space go ahead and
right click onto animation and I go into
Legacy and we will set the blank space
1D so what is a blank space well let's
say it is like a timeline where you can
put different animations and depending
on a value you can transition smoothly
depending on on them so in our case we
want to
change the animations depending on our
character's speed
and 1D is just Just One Direction okay
let's go ahead and select it and again
we have to set the SK mannequin and now
we want to change the name into The
Locomotion
let's go ahead and open this up put it
over here so now the horizontal axis
will basically be the timeline so we
want to change the name into be speed
and then the minimum will be zero and
the maximum will be 500. the maximum
value will be the maximum speed that a
character will be allowed to walk or run
and where I'm getting this value where
if we go into the third person character
blueprint and go into the character
movement component you will see that
currently this set as 500 in Maxwell
speed so that's why I'm getting this
value if you were to change the max
value of that speed you had to change
here alright so now we can go and drag
our animations so we're not to go into
our asset browser now if you don't see
it you can just go into windows and it
will be here
wait so let's go ahead and get our
In-Place animation let's go ahead and
drag it and put it until that now you're
probably wondering why we are not
starting on the idle animation and it is
because we're gonna later make all the
scheme and transition it from the
animation blueprints there so we want to
start already this animation blueprint
with a little bit of speed okay it will
make sense later okay and while we're
doing this but we want to get the in
place animation because it is the the
slowest walk animations like just
tipping over here now we want to find
the walk animation and it will be
the mm walk forward I want to put it
exactly at the middle and now we want to
search for the Run animation and it's
going to be the mm run forward
let's go ahead and put it on to the
right now if I hold Ctrl you'll see that
I can preview the difference on the
speed and how as the loss increases the
character will change the animation and
it just looks really really cool now we
have a detail to turn on this so if you
want you can check that out anyway so
let's go ahead and save it and now we
can close it
let's go back into our folder which was
RPG character animations and now let's
go ahead and go into the animation
blueprint so we have to create a new one
right click animation blueprint again we
want to select the skeleton
and now it's gonna be ABP symbolizing
animation blueprint underscore and then
RPG RPG there we go character
I want to open this guy up
wait so the first thing I want to do is
create a new state machine let's go
ahead and right click State machine
and there we go so now we selected we
can change the name and this will be our
locomotion
since the machine will be like a graph
scheme where we can basically put all of
our animations in let's go ahead and
enter and drag it and now we can create
a new state so this state will be an
idle so basically when our character is
not moving let's go ahead and double
click and now we can go again into the
asset browser and you search for idle
I'm gonna use the new one that we
imported voices I don't break
so I'll drag it and plug it in now
because this idle will be in Loop we
want to Loop animation so I have node
and loop animation let's go ahead and go
back
and now all we can do is drag it and
create a new state and this will be our
walk slash run
so if we start moving Google transition
from the add-on to walk around basically
so let's go ahead and double click in
here and what we want to do is find the
new Locomotion blend space that we have
just created and drag it over here
now depending on the speed the analysis
will change the thing is that we have to
change this dynamically depending on the
player's speed in game so we want to do
is right click and promote to a variable
basically create a new variable great so
later on we will go ahead and you know
assign it at runtime
let's go back
and now we want to do is go into this
transition and double click on it and
what we'll do is just get the speed and
then make sure that it is greater than
one zero sorry so if the speed is
greater than zero it will mean that the
character is currently moving
great so let's go back now and drag the
Walker run uh State and we want to do a
new state now so this will be this top
animation
so basically when the character stops uh
walking or running or whatever it's
doing it will play this nice animation
which is just a simple stop animation
real quick and it just feels much better
like much more fluid and Vivid
um you will see how it looks better
later so now first of all let's enter
into this top animation and let's drag
it in so in our case it was the walk
stop now you're probably wondering well
if we're running and we play a walk stop
animation it might not look very good so
maybe we have to change the animation to
run stop and then also walk stop
depending who walking no with my test I
have actually found out that just using
this single work stop just looks much
better so we're running and then we play
boxed up it feels more natural I don't
know why but it just does so we don't
have to worry about that let's go back
into this scheme
and now in the transition we want to
open it up I want to make sure that
we'll get speed is less or equal than
zero so basically if our speed is pretty
much no we have stopped moving we want
to play this top animation and now from
stop we want to go back to idle once
it's completed now let's set the the
transition and we actually don't need to
put any condition we just need to select
this stick over here which is automatic
rule based on sequence this would just
means that as soon as this animation
finishes playing it will automatically
just go into idle so there's no
condition once I finish this I will just
go to here great so there's two more
things I want to do to this transitions
we want to select it and then the
duration I'm going to put it into 0.3
and then the mode will be on cubic so
the balance settings it just makes it a
bit more smoother and in the stock to
Widow again this will be 0.4 and then
the mode will be cubic okay great so now
we can compile and shape so now what we
want to do is go back into the main and
then grab now we want to get this local
motion dragon and make a cache so
selected and this will be locomotion
now you probably wondering what is a
cashier well okay sure it's basically
used to space and memory so imagine that
we are saving this Locomotion animations
in a pen drive that we can later go
ahead and use
so what we want to do now is create
another state machine and we'll see why
in a second so this state machine will
be the main same machine and he will
basically contain all of the different
state locomotions so for example the
normal unarmed Locomotion the Crouch
Locomotion the
um whatever the swimming Locomotion
later on you know whatever we want
so we want to now plug in into the
output post button what we want to do is
add the default slot and the default
slot especially is the slot or the
animation space that the animation
montages will play and the animation
montages are just animations that plays
um basically
from blueprints so yeah don't worry
about it we'll see later on but
basically the main graph is what we want
to enter right now and on here we always
want to create a new state and this will
be the unarmed
and locomotion
and we just want to enter in here and we
can just pass the cachet so basically we
are having everything more tidy we're
using this pen drive I don't like
calling it bandwidth but I think it you
understand better if I go like that so
we're using this space memory let's
cache this pen drive
as on here as a state so really inside
on here we are passing this whole scheme
but only in one single node which is
just much better
all right so now
this is what we need right now for main
if I compile you'll see that the
animations now start playing great and
now if I were to set the speed over here
into 500
you'll see how it starts running so
things are working let's go ahead and
just set zero and go back and you saw
how actually on the the stop animation
play so just take a look
see how it play this top animation so
really cool all right so
now let's go ahead and sign it so let's
go and enter our third person guide to
blueprint so it's going to third person
uh blueprints
third person character and we want to go
into V board select our mesh in the
cutter mesh here now into animation
class we want to put our new AVP
RPG connector Michael I don't know how
to talk and you can see the new
animations are playing if I press play
nothing happens the things that we have
to go ahead and assign this speed
depending on the player's actual speed
when we play the game so for this we can
go into the event graph and here from
the character basically the owner of
this animation blueprint we can get the
velocity
and they want to do for our variable is
just say Vector length so we want to
convert this Vector which is just X Y
and Z into a nice float so we can just
pass it into speed so don't worry about
this note exactly it's just passing a a
vector into floats nice numbers
basically okay anyway so now if we press
play now we can go ahead and walk and
stop then when we stop place the stop
animation and stop great so everything
is working now we can move on into
jumping because we are not playing
animations of jumping or falling let's
go ahead and save everything Contour
shift s Save A Lot guys just increase it
crashes or whatever always every certain
time save okay
let's go back into our animation
blueprint we want to go into the and
Main uh stay machine and on here we're
gonna basically set up the jump uh I
don't know how we can call it just jump
States I guess so what we want to do is
right click go to creating instead and
it's going to be the jump so it's going
to be our jump animations go ahead and
enter and now we can just
basically find the jump and just plug it
in great
simple as that now we want to do is get
the jump and drag it over here into the
left create a new state and this will be
the falling
and now we can know how to enter and now
we can get an and find the following
animation now again this is a loop
animation so we want to select it and
say Loop animation
now basically don't worry about the
errors it's because the transition
but the thing is that I am basing off uh
this jump scheme from the normal
template from third person because I
think it's great it just does what it is
so it's very simple
now
we want to do is go ahead and create a
state Alias so this is going to be
basically to falling
so this like evolves a shortcut so
instead of manually going ahead and
plugging all this into here we can use
this LDS which is just like a shortcut
like it was just teleporting animations
um so we can have everything more
organized okay
to Falling we want to be able to go from
jump
um to sorry to jump I'm falling if we
are in the normal locomotion
so we are playing the unarmed Locomotion
and we
accomplished the condition that I'm
gonna put in a second
we will go ahead and jump or whatever
let's go ahead and go to jump up here
and we want to use go ahead and double
click and create a new variable this
will be is falling okay and it will be a
Boolean so now you can just drag it and
say hey if we are falling we're gonna go
into jump I'm gonna do exactly the same
into falling over here drag it and
thread and say hey if we are falling
we'll go into this animation over here
now we will need to do something
different into the jump
um conditions go ahead and open it real
quick
and what we have to do is basically
create a new uh variable that's going to
be the velocity
and this is going to be type Vector so
this a bit different as a speed as it
will contain also the direction so now
the things that we can go ahead and drag
it right click split it and we can have
all the access in an individually so
what we want to do is get instead which
is basically up and down vector and say
hey if is greater than 100
and
go ahead and con hold Ctrl and then drag
it you can also move the pins
so basically if we are falling
and our velocity inside is greater than
100 we want to play the jump animation
but if not we want to directly just play
the following so you will see what that
does in a second I will go ahead and
cover it and explain it but
basically we want to do right now is go
into here and select this jump to fall
in and this will be an automatic rule so
as soon as the jumping finishes you go
to point
great so a lot of talking but let's
implement this so what we have to do is
create a new state audience this is like
the other side of the shortcut and this
will be to land
so always happen the same I don't know
how to type so we selected we want to be
able to go to land if we are from
falling or jumping
and as soon as this condition completes
we can continue so we're gonna and
create a new state this will be the land
animation so I want to open the land
and then we want to search land
and then put over here
great
now we want to go out and we want to go
into this transition and we're going to
say well if falling
is not Boolean so if it's basically not
true
we will go ahead and just play blunt
animation and now we go ahead and make
another transitions like this and it's
going to be an automatic rule based on
sequence basically as soon as the
landing animation finishes will go back
into the normal locomotion
so we have to do one more thing as the
invent graph fill up these variables so
the velocity is going to be very simple
just drag it over here and get the
velocity here from this node which we
already had great and now we want to do
is go ahead and add this node which is
sorry about the golfing guys is just
initialize
and then blueprint initialization this
is like the start of the animation
blueprint the begin play so we want to
get this note copy and paste it
basically in the owner I want to cast to
the third person character so we'll
basically access all the variables that
our player has now we want to do is
right click and promote it to variable
and I'm going to change the name into
character so basically just at the start
reference in this character and the
things that we don't have to do it on
the update because there's no necessity
we can use it one time at the start and
that's it more clean code and better
optimize as casting doesn't really
consume anything but it's just better to
have it only one time at every certain
opt-in okay
so we want to do right now is get the
character variable I want to get the
character
if I know how to spell character
character there we go movement component
let's go down
sorry not component just movement go
down and there you go and now we can get
a spawning
and then if it's falling it's passive
here so we will get our variable and
then pass it over here
great so let's go put some comments over
here
so select everything put it over here
so this will be get
get speed and velocity
velocity and then this will be
um is falling
great so now it's unorganized great so
now we can go ahead and test a bit so if
I save
I can go here and if I jump I'll play
nothing so what is happening you're
probably wondering well let's go into
the animation blueprint and let's go
back into the name scheme so the land
animation the thing is that if we double
click and open it you'll see that it has
this thing which is an additive
animation so basically this animation is
designed to play on top of another one
which is basically in our case will be
the normal Locomotion so let's go ahead
and close it
normally but we have to call it as an
additive animation so let's go and drag
this and you say add
itive
so apply additive there you go and now
we want to hold Ctrl and move it into
the additive space leave the Alpha One
and the normal bass will be basically
the cache of The Locomotion so this land
animation will play on top of The
Locomotion and it will just feel much
smoother because basically it is like if
it's Landing but at the same time it's
continuing to to work we have a speed
anyway it's just much better
now if we press play you'll see that we
can jump and then replace the
alternation basically
you can see
the jump on the machine is not playing
so I'm going to go into here I'm going
to go into the main
and the reason is that the the priority
number transition is the same so we have
to make sure that the pretty number on
here
is two so from to fall into falling it
has to be two so now if I jump
you can see the now it jumps and then
Falls
great so we have a nice Locomotion
system yes top animation so it feels a
bit smoother we can jump land
Etc Great so this is the
extreme basic of our Locomotion now
we're gonna basically add crouching
let's go ahead and do that
so control shift s to save everything as
till now let's go into our folder RPG
character animations let's go into
Crouch and now we're gonna go ahead and
create a new animation uh blend space
right click onto animation legacy plan
space 1D again select the character
skeleton and that's going to be crushed
let's go ahead and open this up
so again it's going to be very similar
to the other normal Locomotion but which
Crouch animations so this is going to be
the speed the minimum zero about the
maximum this time is going to be 350
because I mean when we're crouching
we're gonna be slower so instead of
going to until 500 only to 350. so now
we're going to search for Crouch and now
this time we will add the idle animation
onto the left because we're not gonna do
any fancy transitionings and stuff
things simple for the crush and now into
work we can go ahead and put into the
right now of course we're doing the
basics on here but as we go the advanced
Locomotion system will grow and we will
have many more fancy stuff and maybe
animation warping and stuff so we'll see
anyway so as you can see as time those
increases we will start walking and this
is that the animation for walking is
moving so the thing is that it has room
motion let's go ahead and open it up
and we need to enable remote and then
say Force foot locked so now it will be
in place it will not be moving so now I
can go back into the animation blueprint
sorry blend space and now you can see
that it stays there great
so we have to do is go back into our
animation blueprint and go back into the
grade ending graph okay out of the main
so now we want to go ahead and create a
new stain machine
so this will be our crouched
great so we want to create a new uh
cachet post and again this will be
crouched and there we go let's pull this
a bit up
so let's go ahead and enter and it's
going to be very simple we're just going
to have a crouched
locomotion
okay
what is this crap
my guns I don't know how to type there
you go so now in here looking is past
the
Crouch blast face that we have just
created okay
and then we just pass the speed that we
already have the variable assigned
internal thing
great
so
you can also hover everything and then
press q and it will align so that's
pretty handy
so now we have the
Crouch Locomotion setup but now we have
to use it so let's go back into our main
I'll have to create a new state it
should be crouched
a locomotion
so now we can go and create the
transition itself from an art Locomotion
to crouch and then from Crouch to an art
so first of all let's start with the
unarmed to crouch
and we have to do is create a new
variable which is is crouched
and this will be type booleans right so
true false so drag it and get it so if
this is true it will go ahead and
transition
and I will do the opposite in the code
going back so get it scratched not
Boolean
so if it's false we will go back great
compile and Save
now we want to go into the Ben graph
and now we want to do is go up to here
so here we go uh we want to get a
scratch set
over here set it and now what we want to
do is go into the third person Galaxy
blueprint I'm going to create a new
variable it's going to be uh crushed
oh my God I don't know how to spell
Gray
so basically we're gonna get again the
character
I'm gonna get
crushed
so the one that we have just created now
the character one but the one our custom
one that we have created
and now we just want to drag it in and
it's gonna be get uh crushed
okay let's move it over here
and perfect let's go ahead and align
this just a bit
more
beautiful okay
all right so now we need to enable and
disable this Crouch
so we're gonna do is go into the third
person character going to the vangraph
and I started making some code so we'll
need to do is just create a new input
action
so it's going to content third person
input actions let's go right click
input in production and then EA
underscore and it's gonna be Crouch
let's go ahead and open this up and we
don't have to change anything of it just
going closer let's go back and I will
need to go into our collection so this
is a list of all the impos that we have
so we have to basically just add the new
one that we have created which is going
to be Crouch and down here we can start
pressing the keys so we select this icon
now you can press any key in your
keyboard which in a case will be left
control and it will assign
so great so now we can close this and
now we can use this EA Crouch
now of course make sure that of course
is adding the mapping context at the
beginning play but if you're using the
third person template as you should if
you're following this RPG series it's
already great so now what we can do is
go from a starter and then do a flip
flop so basically this will do one thing
and instead well every time this code
the first time will do this and then the
second time will do this the third time
this fourth and this I will just
everything is code it will shift between
one of those
so we want to do now is set a scratch to
through and then in there one set to
false
so now we compile we can press play we
can walk in our normal blank space but
when we left
um control we get this so what is
happening right now
well
uh it is shipped such way
but the thing is that in our question
Locomotion we did not apply the cache so
we need to find the
crushed okay
and now when we press Ctrl now it goes
into Crush so you can see how cool is
looking great
so let's go and do some more things over
here so it can feel a bit better and
what we're going to do is get the
character Moon component and first of
all set the max walk speed into 350 like
we said in the
um
a plant space
and now in here it will do basically the
opposite we'll put it back into 500 and
we can use the same connector here
great so now it will go ahead and
move a bit slower and it feels it's
better
now I think that I have noticed in
Assassin's Creed Origins is that
basically the camera gets a bit more far
away when your crushed let's go ahead
and do that
let's go here and we can just get the
camera boom and then set
um the length satary arm length and
right now it is at 400 I believe
yes so instead of 400 we're going to put
550 for example and they can copy and
paste this and then this will be back to
400.
great so now we can plug in the camera
boom here control shift s to save
anything until now
press play now here you will see that
the camera goes a bit uh further away
now the thing is that it doesn't look
very good because it's napping
um we don't want that we want it to be
smooth we want to interpolate with a
smooth transition let's go back here and
let's make some space before we set the
arm length
and we can get any of these connectors
and you say add timeline
and this will be our Crouch cam distance
timeline great so hold Ctrl is going to
be play from start and then get this out
and This Will Go reverse from start so
we use this same timeline for both and
the things that we can use this trick
which is just reverse it to go back to
normal so we can now delete this other
one and we can just use this so we need
to enter this timeline and add a new
track and this will be a float track and
this will be our length
or Cam link to be more specific I know
this the time that we'll take in our
case it will be just one second now you
can customize everything as you want you
know so maybe it won't take it two
seconds again or 0.3 seconds you can so
you can change I I would put a one I
recommend to put it on one but if you
want to change everything you can so go
ahead and right click and any place and
add a key and now we just need to set
the 10 to 0 and level it to zero and
then we want to click again and it plays
and I set the time to one and value to
one
but one and time to one now we can press
it to one and we have a simple
transition what they will just
interpolate within two you can get fancy
and add more ones to make it a curve and
stuff but I will just leave it like that
and now we have the cam length here so
we can drag it and use this lurb float
uh no I want to get the a hold Ctrl and
put it into the alpha so basically it
will go from 400
to 550 okay so basically now this will
be our new arm length and the thing is
that if we reverse it it will go from
550 to 400 so it is exactly what we want
so we compile and save and go into here
you'll see that when I crouch we have a
nice zooming in and out look at that
looks so cool
oh yes
alright so now we can go ahead and stop
so we're gonna make the last thing in
this video I think it's a bit too long
but I just want to add this last thing
and why I have watched beeping let's
just wait a second until this watch
stops beeping
so we are going to add leaning and then
we just improve so much of The
Locomotion it will make it smooth out of
every character when it turns it is not
like so stiff it will like Bend IN into
the side that is bending it is much
better and it has great again Hazard so
we have to add it alright so we're going
to do is go and create some animations
from uh for the Leaning now don't worry
we're not gonna make anything complex we
are gonna use a very handy tool in
Unreal Engine so let's go into
characters mannequins
animations and many and now you see the
Run forward animation that we're using
so we want to do is now find over here
the other I want okay let's go back here
animations many
here
so we want to
come on
money there we go so we want to find the
RPG connect folder
and you will see locomotion
so actually first let's go into
animations and create a new
lean folder okay and he will place the
new animation so go back into the money
I want to do now is get the Run forward
animation and drag it into lean but be
careful don't move it only copy okay so
now we go into lean we will have it here
so now this will be lean and let's say
it's going to be uh underscore left
and I'll duplicate it and this will be
lean underscore right
and if I spell it correctly
let's start with left
so let's go ahead and pause it okay
pause it and then drag it into the start
position of the timeline okay so the
first thing I have to do is make it as
an additive you remember that we already
saw the how the landing was additive
we're going to do the same with our
leaning so we'll play the you know The
Locomotion behind it but it will play
this leaning towards it so what we want
to do is go into the additive and in
type and we're going to say mesh space
it's going to be a bit different than
the landing one it's going to be mesh
space and then the post type is going to
be scaled okay and now in here we want
to find our original run animation score
and to run I want to go into the mm run
forward okay
great
so now we want to do is save this and we
want to go into the skeleton tree and on
here we want to select the pelvis okay
we don't want to select the root because
I'm not in the animation this will be
overridden but we want to go into the
pelvis which is our next and top bone
and what we want to do is go into our
rotation tool okay over here and make
sure that you have a snapping enabled on
the rotation of 10 degrees
so now we want to do is rotate this
character 10 degrees into the left
in this axis over here so
in our left will be here select okay so
where we are looking now his left so in
our case we'll be to a right so we want
to do is get this and just
like that minus 10 degrees and now what
we want to do is press this plus Cube
here
is a keyframe and then we can save it
and now when we press y you'll see that
it's just playing
um leaning we can close it and you will
see that when we open again it's still
leaning great so we'll do exactly the
same with the right butt bending into
their place let's go ahead and open this
pause it all to the left and go first
into as details and the additive type to
mesh and then again scaled and then find
the original mm run forward and now go
into skeleton tree go into the pelvis
with the rotation tool snapping and 10
degrees now this time will be two hits
left so and again in our right and left
so
10 degrees 2 hour left to his right and
then again remember plus key and save
and then close a gray so now we have to
make another blend space yeah loving
blend spaces right click animation
Legacy plant space again with the same
skeleton and this will be the lean
capital L plan space let's go ahead and
open this up
go back to as details now this will be
basically the
well lean value okay let's just say
limal so this will be in degrees so the
um minimal will be 45 and the maximum 45
okay and now we want to get our link
animations and our left to be on the
left side of the
scheme and the right on the right side
so now if I hold Ctrl you see how it
leans depending on the value now you
want to have a more exaggerated value uh
leaning and stuff you can change the
degrees and stuff and the animation and
so on but I do recommend sticking with
this values because I have already
tested it and it looks pretty fine
so now we can save and close it so now
we need to go back into our animation
blueprint yes I get into the Mayhem so
what we have to do now
is go into our local motion graph I want
to go into the walk on run
as state
so as you remember we made the
animations additive so we can just drag
it and say apply
additive mesh space so this time it will
be mesh space okay
so the bass will be this animations
running but this time the additive will
be our leaning blend space go ahead and
drag it into the additive space we'll
release the alpha into one and now we
want to do is right click and create
this into the value and now this will be
the jaw Delta
and now there's a thing that we have to
do is just go ahead and drag this and
then multiply it by -1
basically we want to invert
um
delete okay okay so if not it will be to
the other side great so now we want to
compile and save now the thing is that
nothing will happen because well if we
press play we are not saying that uh
now if I were to put it in 45
and compile
to see the now
it doesn't do anything
wait wait
yeah it should change okay don't worry
don't worry about it the thing is that
uh we need to apply the uh while we are
playing the game
uh sorry minus one not point one sorry
about that now we can test it sorry
sorry make sure that you don't make any
mistakes like that okay
so now you will see that now it's
leaning okay you see that great
set it back to zero
and now we want to go into the bank
graph right
so we want to go here and make the
Leaning so we want to get the jaw Delta
rocket and set over here
to login in so we want to do is get our
character
I want to get the actor rotation
okay and now we want to do is go ahead
and get this and make a Delta rotator
and basically this will be our B so
let's go ahead and control and drag it
here and the a we're going to go ahead
and create a new variable which will be
our last
rotation
that's frame rotation so basically our
rotation in the last frame so this
basically just gonna basically
interpolate it in a nice smoothly way
and we will need to know the last
rotation last frame in order to
basically the transition from that last
frame into the new one because not it
will be Snappy and we don't want that
okay
now once you just right click and split
it so we have all the different vectors
I want to get the jaw and we want to
divide this number by the Delta time now
we want to go ahead and right click
promote this variable Delta time
okay now the thing that we have to
assign this at a time and the great
things that we have it over here so we
just want to put this into the left drag
the Delta time
and plug it in here and this will be the
dot time right as simple as that
actually we can use I think just plug it
on here
yeah man that's right okay
and now we want to do is divide this one
more time
but this time this will be our lean
intensity so I have found that 10 is a
pretty good value now if you
change the value and you can test it out
to see if more and less linear is better
but 10 is pretty good so we want to
interpolate a float so this will be our
Target okay and our current will be our
current
um jaw Delta
again
okay and what we want to do right now is
the speed set it into 10 again okay now
this would be this the speed that it
will change the lean okay
again you can play with the settings and
then Delta time again will
place not not your Delta Delta time I
know it's very confusing but a and this
is just Advanced calculation so don't
worry if you didn't really understand uh
like the core aspect of it but
a lot of different vectors and values
and now what we want to do is get the
last frame rotation
and basically fill it with this last
frame rotation over here
okay
and there we go
sorry what did what that why no
the getaction rotation
of course if not it will be the same one
we want to get this one okay
um we can just double click in order to
add this little notes so it looks a bit
better
now we can just select everything and
press C lean uh
yes
calculate
calculate lean
what is wrong I don't know how to type
okay calculate lean
there we go
so now we can go ahead and compound save
and if I press play you guys even want
to walk I go ahead and lean so cool look
at that looking so cool and it just
makes it so cool and honestly right now
maybe it doesn't feel like
too crazy but when you start getting all
the aspects and when we start adding um
the bolting with the parkour system
and we change the mannequin to an actual
character and you start getting like
Echo balls and of um overriding
animation stays on top of him it will
start looking so so cool like trust me
so we're gonna make two more things over
here and it's first of all I'm gonna
change the character to money basically
the things that I always use
um Queen for my tutorials so so to just
change it up to this series I'm gonna
tune into Manny and I'm gonna basically
find these materials over here I'm gonna
duplicate it
um basically this many
many the two ends uh underscore
um let's make the character blue
oh yeah let's make it blue okay and then
we need to get there's one money
uh underscore blue two so basically we
just want to start by coughing openness
the this materials I want to go into the
tint so make sure it's enabled I want to
basically make it a bit blue
so now we can get this uh
hex value and then copied and save it
close this and open the money too and it
will tint go into here
and this hex value pasted
say okay and save it
and it will go ahead and save great now
we can go into the character and now in
this time we can put the money
blue one and money
Bluetooth and now we have a
what is happening oh did I stop okay the
other way around
this sorry about that twins
Money Two
and money one there we go I did the the
other way so let me just change the name
into money
so we have to so yeah this is the thing
we have we need to change this
temporarily into
three
so now this will be
two and then this will be back to one
okay so now we have a cool character
it's a bit different to spice up until
we have a proper you know Assassin's
Creed character
so yeah whereas we have some leaning in
really cool we have some top animations
jumping uh we have crouching as you can
see like everything is looking
absolutely amazing
so if you want to go ahead and set up a
source control for this game so
basically everything will be in a server
and we pull changes just in case
something goes wrong and you can recover
your last version or you want to
collaborate with different people go
ahead and let me know in the comments
and I can go ahead and just make a quick
episode show me how to create the source
control
and if you don't know how what is a
source control it's basically managing
everything okay in the cloud so we can
have some uh comment commits that are
called comments and it's just a version
of your pride in GitHub for example and
then we can just tune in back and
forward
so that's it guys if you enjoyed the
tutorial I really appreciate if you
could like the video and subscribe to my
channel I have lots of Unreal Engine if
I throw so go ahead and check them out
I'm very excited to continue with this
incredible RPG Series so go ahead and
support it guys because it's gonna be
massive and incredible
server and basically show the progress
that you're making you know I want I
want to see you progress on the RPG and
look at all said bye bye
foreign
[Music]
関連動画をさらに表示
Unreal Engine 5 RPG Tutorial Series - #9: Combat
Unreal Engine 5 RPG Tutorial Series - #20: AI Behavior Trees Patrolling
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 - #3: Vaulting with Motion Warping
Unreal Engine 5 RPG Tutorial Series - #14: Equipment System
5.0 / 5 (0 votes)