Lets then start by creating our Project. All we need for this System is a 3D Project. Unless there's any current problem with using HDRP or URP
with Cinemachine or the New Input System, we should be able to choose any 3D Template we want. I'll go with a simple normal 3D Template. For the Unity version I'm using, I'm currently using 2020.3
but you should be able to use any you want. I do recommend at least 2020 as we'll be using serialized
properties, but, if you are using 2019, that should be fine as well, simply swap the properties with public variables instead or use non-automatic properties. For the name and folder of the Project, choose the one you
desire. We'll start by setting up a base namespace to make sure no
name conflicts happen. To do that, we go to "Edit > Project Settings > Editor >
Root Namespace". I'll name mine "GenshinImpactMovementSystem". Of course, give it a name you like. For simplicity, this will be the only namespace we'll be
adding in this tutorial. I also went ahead to Kenney's website and downloaded his
Prototype Textures. You can use normal materials if you prefer, in case you
don't feel like downloading them. I'll have mine be inside of a folder named "Materials". Next, lets download Cinemachine. To do that, we go to "Window > Package Manager > Packages:
Unity Registry" and search for "Cinemachine". Make sure you select the latest version here, which by the
time of this video is "2.8.4". This is simply because there are some bugs happening in the
older versions so we're just making sure we've got a working one. If by the time you watch this video the default version is
at least "2.8.4", then you should be fine. When that's done, press "Install". When Cinemachine is done installing and importing,
go ahead and search for "Input System". Select it and feel free to Install it with the default
version. A warning should show up asking you
if you want to disable the old Input System. While it's not necessary, we don't need the old Input System
for this tutorial so I'll go ahead and press "Yes". Do note that this will restart your project. If you chose "No", make sure that in
"Edit > Project Settings > Player > Other Settings" your "Active Input Handling" is set to
"Both" or "Input System Package (New)". Your project will also restart when you change this option. That's all for our Packages, so we'll now go ahead and start downloading
our Character Model and its Animations. We'll of course be using a free model and free animations, so do not expect them to look as good
as Genshin Impact Animations. To do that, we'll be using a website
owned by Adobe named "Mixamo". So go ahead and open up "https://www.mixamo.com/". You'll need to login with an Adobe account to download the
assets but you can create an account using Google or Facebook if
you do have them. When you're logged in, go ahead and open the "Characters"
tab. This is the list of character models we can choose from. You can choose the character you want, but I'll go ahead
and search for "Y Bot" and select it. Once you have your character model selected,
press "Download" at the top right. For the "Format", make sure you choose "FBX for Unity". I'll leave the pose as "T-Pose". When that's done, press "Download" again. I'll be renaming the file to "CharacterModel". Then, in Unity, I'll create a new folder named "Models", followed by "Characters" and "Player" inside, and then drag our Character Model here. With our Character Model in Unity,
we of course need its animations. So back into Mixamo, go on to the "Animations" tab. We now have a list of animations we can download. For now, we'll only be downloading animations
for our Base Movement System. Note that the only important setting in the "Download" tab
is the "Format", which should be set to "FBX for Unity". I'll also be renaming the files but
I'll leave the new names in the screen. Here is the list of Animations I'll be downloading: "Idle". "Walking", with an "Overdrive" of "15"
and the "In Place" option enabled. "Running" around the bottom with
the "In Place" option enabled. "Running" above a bit, with the "In Place" option enabled. "Idle To Sprint". "Run To Stop" at the right. "Stop Walking", with a "Starting Trim" of around "45". "Stop Walking" again but with an "Overdrive" of "25",
"Character Arm-Space" of "55" and "Starting Trim" of "50". "Jumping" on the second tab at the right, with a "Starting
Trim" of around "37". "Falling To Landing" with a "Starting Trim" of around "22". We have all of the animations we need,
so it's time to add their files into Unity. Before we do that, make sure you have
the following names in your Animation Files. Back into Unity, select all of our Animation Files
and drag them into our Models Folder. Now, these are Models that come with an animation. We already have our base model so we
of course only want the animation clips, so we'll have to extract them out
of the assets we've just imported. If we go ahead and open up
one of the assets by clicking on the arrow icon we can see a bunch of other assets inside. The one we want is the last asset,
which is an animation clip. Now, if you kept the "ybot@" part of the file name, your animation clip should have the same name
as the text that follows it. This is why I've asked you to rename the files. If you did rename the files to not contain the "ybot@" part
or whatever name your character model has, then the animation clip will come named as "mixamo.com" and
you'll have to rename them through Unity instead, so I recommend just renaming and redragging
the assets with the correct names. To get these animations out of our assets, we simply open up
every asset, ctrl click each of the animation clips and then press "Ctrl + D" to duplicate them. When that's done, we won't be needing the downloaded assets
anymore so feel free to remove them. Do not remove the "CharacterModel" asset though. We now have our animations,
so lets add them to a new folder. In the Assets folder, create a new folder named
"Animations", followed by "Characters", "Player", "Clips" and "States". I'll drag every single animation to the "States" folder. Then, inside of this "States" folder,
I'll create a few more folders: "Moving", "Stopping", "Landing", "Grounded" and "Aiborne". I'll add the "Walk", "Run" and "Sprint" animations to the
"Moving" folder. Then, I'll add the "Light", "Medium" and "HardStop"
animations to the "Stopping" folder. The "LightLanding" animation
will go to the "Landing" folder. When that's done, drag the "Jump" animation
to the "Airborne" folder. Whatever remains here except the "Airborne" folder
will be moved onto the "Grounded" folder. It's alright if you have no idea what these folder names
mean as it will become clear later on, we're just adding them now for organization purposes
and to not need to do it later. Before we keep going, there were some animations that we've
downloaded that didn't really have the "In Place" option. This means that they will move the player forward without
our input, which is something we do not want. We will change that in the following animations. Start by right clicking in the Project tab
and add a new "Animation" tab. I'll dock it to the right for a bit and resize it. Then, double click on the "Dash" animation
on the "Grounded" folder. The Animation Window should now have
all the keyframes of this specific animation. Open up the "Hips: Position" tab
and select all "x" and "z" keyframes. Then, press the "Delete" key to delete them. Repeat these steps for the "LightStop", "MediumStop" and
"HardStop" animations in the "Stopping" folder as well. Next, we'll need to some some of the Animations
to keep looping after they run once. We can do that by enabling the "Loop Time"
option in the Animation Clip. We'll do it for the "Idle" Animation
and the "Walk", "Run" and "Sprint" Animations. Our animations are now set-up properly.