background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "Make your Characters Interactive! - Animation Rigging in Unity"

input logo icon
Video tags
|

Video tags

brackeys
unity
unity3d
asset
assets
easy
to
howto
learn
tutorial
tutorials
game
development
develop
games
programming
coding
C#
how
beginner
animation
animation rigging
rigging
character
procedural
dynamic
head
follow
aim
ik
inverse
kinematics
two-bone
bone
bones
skeleton
rig
move
place
feet
look at
interact
environment
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:01
characters to interact with things
00:00:03
around them sometimes they need to pick
00:00:05
up objects sometimes they need to aim in
00:00:08
the right direction and sometimes they
00:00:09
just need to place their hands and feet
00:00:11
correctly on the environment this used
00:00:13
to be a pretty complicated task but
00:00:15
luckily unity has added a feature called
00:00:17
animation rigging that makes it so much
00:00:19
easier it's currently in preview but
00:00:22
most of the big features have already
00:00:23
been implemented but Before we jump into
00:00:25
unity and start using it let's have a
00:00:27
look at how animation rigging works also
00:00:29
this video is sponsored by unity so
00:00:32
normally when we have an animated
00:00:33
character in unity it consists of a few
00:00:35
things a base object with an animated
00:00:38
component this controls what animations
00:00:40
to play as a child of this object is the
00:00:43
mesh itself this normally has a skinned
00:00:45
mesh renderer component and is
00:00:47
responsible for rendering the character
00:00:48
itself and finally we have the character
00:00:51
skeleton often called the rig this is a
00:00:53
hierarchy of game objects that make up
00:00:55
the individual bones of our character
00:00:57
for example this character has a pelvis
00:00:59
bone that leads to the spine that leads
00:01:01
to the thighs that leads to the calf and
00:01:03
then the foot so character animation
00:01:05
basically works in three steps the
00:01:08
character plays on animation determined
00:01:09
by the animator the bones are then moved
00:01:11
around by that animation and the mesh of
00:01:14
the character then shapes itself to
00:01:15
follow the bones using the skin mesh
00:01:17
renderer but what if we don't know
00:01:18
beforehand exactly where we want
00:01:20
opponents to go animations are fixed so
00:01:23
they don't always fit perfectly with the
00:01:24
interactive parts of our game say for
00:01:26
example we want a character to look
00:01:28
towards the player well in this case we
00:01:30
need to change the rotation of the head
00:01:31
while the game is running depending on
00:01:33
the position of the player but we can't
00:01:35
do that if an animation is already
00:01:37
controlling our head bone this is where
00:01:39
animation rigging comes in with
00:01:41
animation rigging we basically create an
00:01:43
extra rig on top of the original one
00:01:45
that then overrides part of that
00:01:47
animation think of this like a much
00:01:49
simpler rig which only has two controls
00:01:51
that we need in this case we would
00:01:53
create a rig with the multi aim
00:01:55
constraint this component would
00:01:56
reference the bone that we want to
00:01:57
control in this case the head bone as
00:02:00
well as a new object that we create to
00:02:01
act as the target when we then play we
00:02:03
can see that our original animation
00:02:05
plays just fine but our head rotation is
00:02:07
being controlled by the new rig this
00:02:09
allows us to do many things just using
00:02:11
different kinds of constraints it
00:02:13
when it comes to the character
00:02:14
interacting with objects so with that
00:02:17
explanation let's jump into unity and
00:02:19
try it out some community and as you can
00:02:21
see I'm using version 20 28.1 animation
00:02:24
rigging will also work with 20193 but
00:02:26
unity have added some nice convenience
00:02:28
features to make setup easier in the new
00:02:30
version and the first thing that we
00:02:31
wanted to do is go ahead and install the
00:02:33
animation rigging package but it's
00:02:35
currently in preview so first we have to
00:02:37
make sure to enable preview packages to
00:02:39
do this we go under edit go to the
00:02:41
project settings go under package
00:02:43
manager and make sure to check enable
00:02:45
preview packages with that we can simply
00:02:48
open up the package manager window so I
00:02:49
go window package manager here at the
00:02:52
top we'll make sure to show all packages
00:02:54
and now we can just search for animation
00:02:57
and here is the animation rigging
00:02:59
package let's simply select that and
00:03:01
install it and that's it the package is
00:03:06
now ready to be used now as you can see
00:03:08
I've gone ahead and set up this very
00:03:10
simple example scene with just a camera
00:03:12
ground and a character and with all the
00:03:15
talk of bones I thought that nothing
00:03:18
would be more appropriate than an actual
00:03:20
skeleton the skeleton character here is
00:03:22
freely available on the asset store will
00:03:24
of course have a link for that in the
00:03:25
description now this character has an
00:03:27
animator here that if we hit play
00:03:30
just place the idle animation over and
00:03:32
over we can see that inside of the
00:03:35
animator window but remember we could be
00:03:37
playing any kind of animation and we can
00:03:39
easily switch between them while
00:03:41
overriding some of this movement but
00:03:43
we'll see that later now the first thing
00:03:45
that I recommend you do is setup
00:03:46
animation rigging to show some of the
00:03:48
bones that are making up our character
00:03:50
and we can actually do this really
00:03:52
easily by simply selecting our character
00:03:54
going animation rigging and selecting
00:03:56
bone renderer setup as you can see this
00:03:58
adds a component that references all of
00:04:01
the transforms that make up our rig this
00:04:03
is a rig here and these are all the
00:04:04
different bones inside of that rig and
00:04:07
as you can see they're all reference
00:04:08
here and it simply displays them inside
00:04:11
of the scene view we can go ahead and
00:04:13
change the size of the bones the color
00:04:15
and the shape but for now the default
00:04:17
settings are going to do just fine and
00:04:19
this is not only going to show the bones
00:04:21
it's also going to allow us to select
00:04:23
them using our mouse which is just
00:04:25
really handy
00:04:27
now the second thing that we're gonna do
00:04:28
is create a rig remember animation
00:04:30
rigging works by creating an extra rig
00:04:33
on top of our original one that is going
00:04:35
to modify our movement to do that again
00:04:37
we just select our character we go
00:04:39
animation rigging and hit rig setup and
00:04:42
as you can see that creates another
00:04:44
component this is the rig builder which
00:04:46
now has a rig layer called rig one and
00:04:49
if we click that we can see that this is
00:04:52
an object that is now under our
00:04:54
character called rig one with a simple
00:04:56
rig component so this is where we're
00:04:59
going to be building our rig in other
00:05:01
words we are going to be adding
00:05:02
constraints under this object if example
00:05:05
we wanted the head of our character to
00:05:07
be constantly looking at a target we
00:05:10
could go ahead and add a multi aim
00:05:12
constraint so I'm gonna right click on
00:05:14
this object here and create a new empty
00:05:16
object under it I'm gonna rename this
00:05:18
object to head aim and I'm gonna go
00:05:20
ahead and add a component here go into
00:05:23
animation rigging and here we can see
00:05:24
all the different constraints I'm gonna
00:05:26
select multi aim constraint now here we
00:05:29
need to fill out a few things the first
00:05:31
one is the constraint object this is
00:05:34
what we want our constrain to apply to
00:05:35
in our case that's the head since we
00:05:38
want to be controlling the head with
00:05:40
this component so I'm gonna go under our
00:05:42
skeleton here and I'm gonna go ahead and
00:05:44
find the head and drag that in then we
00:05:47
have the aim axis in our case that is
00:05:50
going to be the y-axis and finally we
00:05:53
have the source objects in other words
00:05:55
the target that we're going to be aiming
00:05:57
towards you can create multiple targets
00:06:00
here and blend between them for now I'm
00:06:01
just gonna go ahead and create one
00:06:03
target so let's go under our hit aim
00:06:05
here
00:06:06
that's right click and create a new
00:06:07
object let's again rename this object
00:06:10
I'm gonna call it target and instead of
00:06:13
having this just be invisible inside of
00:06:15
the editor let's go ahead and add a
00:06:18
gizmo so we can do that down here in the
00:06:20
right hand corner we can hit the plus
00:06:21
sign and this allows us to choose an
00:06:24
effector gizmo so first under the shape
00:06:26
here we can search for effector and as
00:06:29
you can see there are some different
00:06:30
ones there's a ball a cube a circle a
00:06:34
locator and a square I'm gonna choose
00:06:36
the ball effector for this one I'm also
00:06:38
going to set the size to something like
00:06:40
point two and now we can clearly see the
00:06:43
target then we can go back to our head
00:06:45
aim and simply assign this target as a
00:06:49
source object and it should actually
00:06:51
work now but under these settings we
00:06:53
have the possibility to limit how much
00:06:56
our head can rotate which is probably
00:06:58
something we want to do because there is
00:07:00
after all a limit to how far we can
00:07:02
stretch our neck it might not apply to
00:07:04
this skirt and guy right here but it's
00:07:06
probably still going to look better if
00:07:08
we added so under the minimum limit here
00:07:10
I'm gonna put in minus 100 and as the
00:07:13
maximum limit I'm gonna put in 100 so
00:07:16
now we can only rotate 100 degrees in
00:07:18
either direction and that's it if we now
00:07:21
go ahead and play we can see that our
00:07:23
head immediately snaps to look at the
00:07:25
target and if I now change this target
00:07:28
around as you can see our head just
00:07:31
follows awesome and we could of course
00:07:34
put this target anywhere we'd like we
00:07:36
can have it follow around a player
00:07:38
character we could place it if something
00:07:40
important is happening say an explosion
00:07:42
happens over here we probably want the
00:07:44
characters to notice we can do so much
00:07:47
with this stuff and as you can see it
00:07:49
works perfectly as long as we don't get
00:07:51
too far behind the character next really
00:07:54
aren't made to stretch this far and it
00:07:56
does lead to some weird behavior so for
00:07:58
this I would recommend adding some kind
00:08:00
of script that reduces this effect if
00:08:01
the target gets behind the character
00:08:03
look at the under the rig here there is
00:08:06
a weight this allows us to control how
00:08:08
much this constraint should influence
00:08:10
our character so if I go ahead and dial
00:08:12
that down we can see that our head is no
00:08:15
longer being influenced by the weight so
00:08:17
what you could do is simply reduce this
00:08:19
using a bit of code if the target gets
00:08:22
too far behind the character so weights
00:08:24
make it really easy to control when to
00:08:26
apply constraints and we can actually
00:08:28
control the weight of individual source
00:08:30
objects as well if we select the head
00:08:32
aim there is a weight slider here under
00:08:35
the source objects also right now for
00:08:37
example it looks a bit weird because
00:08:39
only the head of our character is
00:08:41
rotating normally humanoid characters
00:08:43
will rotate a bit of their chest and
00:08:45
arms as well so let's quickly add that
00:08:48
using the weight slider to do this we
00:08:50
can simply select our head aim and
00:08:51
duplicate it so I'm gonna press control
00:08:53
D
00:08:54
we can then rename this to chest aim and
00:08:56
instead of having a separate target for
00:08:59
this that's delete that let's take our
00:09:01
target here and move it outside of these
00:09:03
two so it's a separate object and let's
00:09:05
also assign that to our chest so now
00:09:07
both are heading and chest aim are using
00:09:10
the same target and what we can simply
00:09:12
do is go into our chest aim and reduce
00:09:14
the weight so I'm gonna put that down to
00:09:17
something like point three and instead
00:09:19
of constraining the head here let's go
00:09:22
ahead and constrain the spine so I'm
00:09:24
going to take the spine one and drag
00:09:26
that in instead so now we have two multi
00:09:28
aim constraints affecting two different
00:09:30
parts of the body with eight different
00:09:32
weight and that means that if we play
00:09:34
and move around our target we can see
00:09:37
that our entire body is now rotating a
00:09:40
bit towards that target which makes the
00:09:42
movement seem a lot more natural awesome
00:09:45
and remember how I talked about that we
00:09:47
could apply any kind of animation well
00:09:49
if I go in to the animator now on this
00:09:51
character and change to a walk animation
00:09:54
it just works really cool now there of
00:09:58
course many more constraints that we can
00:09:59
apply to achieve different results one
00:10:02
that I use a lot is the two bone I
00:10:04
constrict
00:10:05
this will allow us to have the arms and
00:10:07
legs of our character probably bend to
00:10:10
follow a target so you can just imagine
00:10:11
how useful that is let's try to set up
00:10:14
one for the right arm and we could of
00:10:16
course add this inside of the same rig
00:10:18
but since we're affecting a completely
00:10:20
different part of the body let's go
00:10:22
ahead and create a separate one so we'll
00:10:24
select our character look under
00:10:25
animation rigging and let's again press
00:10:28
rig setup as you can see this adds a not
00:10:30
the rig layer to our rig builder and
00:10:32
again and not the object and maybe we
00:10:35
could rename these two to something
00:10:36
other than rig one and two let's have
00:10:38
the first one be head rig and the second
00:10:41
one be arm rig then inside of the arm
00:10:44
rig we can right-click and create an
00:10:46
empty object let's rename this one to
00:10:48
arm mover let's set a component corner
00:10:52
animation rigging and select lead to
00:10:54
bone ika constraint now as you can see
00:10:56
this text in three bones instead of just
00:10:58
one that's because it will apply some
00:11:00
natural movement so natural bending of
00:11:02
the bones as long as we have three bones
00:11:05
in sequence so in our case we need the
00:11:07
route mid tip to be the bones that make up our arm
00:11:10
let's go under our spine here under the
00:11:12
neck let's find our left arm here we
00:11:15
have the upper arm then the forearm and then the hand so
00:11:17
let's start with the hand here and
00:11:19
assign that to the tip we're going to
00:11:21
assign the forearm to the mid and the
00:11:23
upper arm to the root of course we also
00:11:25
need a source object as you can see the
00:11:28
target is currently none so let's go
00:11:30
under our arm rig and arm mover here
00:11:32
let's right click and create another
00:11:34
empty object let's rename this one to
00:11:36
target and as you can see our target is
00:11:39
currently placed down here instead we
00:11:42
want this to be placed on the hand
00:11:43
because we are going to be moving around
00:11:45
our hand and arm with this object so to
00:11:48
snap it to our hand we can simply select
00:11:50
the target then hold down control and
00:11:52
select the hand then go under animation
00:11:54
rigging and hit a line transform and as
00:11:57
you can see the target immediately snaps
00:11:59
to our hand we also want to display this
00:12:02
with a gizmo so let's go to the bottom
00:12:04
right corner and hit plus again we can
00:12:06
choose an effector shape I'm going to
00:12:07
search for effector I'm gonna choose the
00:12:09
square root vector I'm gonna set the
00:12:11
size of this to something like point
00:12:13
three and there we go we now have a
00:12:15
square here that we can select and move
00:12:17
around and finally let's go to the arm
00:12:19
mover and assign this target and that's
00:12:21
it if we now hit play we can see that
00:12:24
while our character is playing an
00:12:26
animation our hand is now remaining in
00:12:29
place and that means that we can
00:12:31
actually select this target object here
00:12:33
and move around our hand even rotate it
00:12:36
in any way that we'd like and our arm
00:12:38
will appropriately follow really really
00:12:42
cool and a cool tip is actually to move
00:12:44
the target while the game is running to
00:12:46
somewhere you think looks cool like here
00:12:49
and then just copying the placement by
00:12:51
right-clicking on the transform and
00:12:53
selecting copy weld placement we can
00:12:56
then stop playing and go to the target
00:12:58
right click on the transform and hit
00:13:00
paste world placement so if we hit play
00:13:03
indeed the arm goes right up and we can
00:13:06
use this for all kinds of things like
00:13:07
placing the hands correctly when holding
00:13:09
a weapon now in our case this is what we
00:13:12
want but sometimes we don't want the
00:13:14
hand to snap to the target sometimes we
00:13:16
want to just keep that offset and in
00:13:18
that case we can go under the arm mover
00:13:20
go
00:13:21
settings and under maintain target
00:13:23
offset we can choose whether to do that
00:13:25
on position rotation or both just
00:13:28
something that's good to know there and
00:13:29
again we can adjust this using the
00:13:31
weight slider imagine for example that
00:13:33
all the skeletons are gathering and they
00:13:36
want to check if everyone is present
00:13:37
John are you there of course you can
00:13:41
change the weight and position through
00:13:43
script you can change it through the
00:13:45
animation window and everything even
00:13:48
works with timeline now as well so you
00:13:50
can just imagine the possibilities and
00:13:52
the good thing is that animation rigging
00:13:54
runs on jobs so it's very performant one
00:13:58
thing to note is that because it runs on
00:13:59
jobs
00:14:00
you shouldn't reassign targets while the
00:14:02
game is running so if you need to change
00:14:04
between following different objects I
00:14:06
would recommend creating a script that
00:14:08
just moves the target to the right
00:14:10
object and of course from here it's up
00:14:12
to you to start playing around with
00:14:13
adding different constraints as you can
00:14:16
see there are a lot to choose from
00:14:17
luckily they're all really well
00:14:20
documented well of course have a link to where you
00:14:21
can learn more about them in the
00:14:23
description another thing that is good
00:14:24
to know is that multiple constraints
00:14:26
within a single rig applied based on
00:14:29
their order in the hierarchy so if
00:14:30
you're working with multiple constraints
00:14:32
in one rig the top one will be applied
00:14:34
first in our case here that's the
00:14:36
heading and then the chess team gets
00:14:38
applied the order of the rigs however
00:14:40
are based on the order of the rig layers
00:14:43
in the rig builder so under a rig
00:14:45
builder component in our character here
00:14:47
we can change the order of individual
00:14:49
rigs and if you need some good examples
00:14:51
on how to use some of these constraints
00:14:53
you can simply go to the package in the
00:14:55
package manager and here we can look
00:14:57
under samples let's import these and
00:14:59
this will create a unity folder here
00:15:02
with some constrained samples and if we
00:15:04
open up the scenes folder we can see
00:15:07
that there are lots of examples for the
00:15:08
different ones of course if you're using
00:15:10
Europe Eli key you might have to update
00:15:12
some of the materials we can do that by
00:15:14
going edit render pipeline Universal
00:15:16
render pipeline upgrade project
00:15:18
materials to universal and hit proceed
00:15:20
and then everything should show up and
00:15:22
as you can see here's an example of two
00:15:24
bonide k one of the multi aim one for
00:15:27
blending one for I K on an entire chain
00:15:30
of bones one for parenting if you want
00:15:32
to have objects follow your
00:15:34
and the list pretty much goes on as you
00:15:37
can see it can get pretty crazy awesome
00:15:39
and that's pretty much it for this video
00:15:41
if you enjoyed it make sure to subscribe
00:15:42
and ring the notification bells so don't
00:15:44
miss the next one well of course that
00:15:46
links to where you can learn more about
00:15:47
animation rigging in the description
00:15:48
including a TDC talk on some more
00:15:50
advanced use cases on that thanks for
00:15:53
watching and I will see you in the next
00:15:54
video thanks to all the awesome patreon
00:15:56
supporters who donated in May and
00:15:58
especially thanks to face Samara fire
00:15:59
lost to violence locked forever replica
00:16:01
studios na'vi ninja SOT Mike Jason
00:16:04
Narita SKU
00:16:05
Luna set piano satin black Donna team
00:16:07
Cascone 10 - Sam Jacob Sanford no he was
00:16:10
sake mug and 20 rod Gregory Pierce
00:16:12
Michael Cobb of the mighty Zeus Owen
00:16:14
Cooper as in the Pierce Erasmus and
00:16:16
serious mode you guys Rock

Description:

Let's create procedural animations using Animation Rigging! ► This video is sponsored by Unity. ● Learn more about Constraints: https://docs.unity3d.com/Packages/[email protected]/manual/ConstraintComponents.html ●GDC talk on Animation Rigging: https://www.youtube.com/watch?v=XjMKbElVNmg ● Download the Skeleton: https://assetstore.unity.com/packages/3d/characters/creatures/dungeon-skeletons-demo-71087?aid=1101lPGj ● Download the Knight: https://assetstore.unity.com/packages/3d/characters/humanoids/strong-knight-83586?aid=1101lPGj ···················································································· ❤️ Donate: https://www.paypal.com/donate/?hosted_button_id=VCMM2PLRRX8GU ► Join Discord: https://discord.com/invite/brackeys ● Website: https://brackeys.com/ ● Twitter: https://twitter.com/BrackeysTweet/ ● Instagram: https://www.facebook.com/unsupportedbrowser ········································­­·······································­·­···· ► All content by Brackeys is 100% free. We believe that education should be available for everyone. ❤️ Donate: https://www.paypal.com/donate/?hosted_button_id=VCMM2PLRRX8GU ········································­­·······································­·­···· ♪ "ES_Dress Code_Black - oomiee" by Epidemic Sound

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "Make your Characters Interactive! - Animation Rigging in Unity" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "Make your Characters Interactive! - Animation Rigging in Unity" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "Make your Characters Interactive! - Animation Rigging in Unity" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "Make your Characters Interactive! - Animation Rigging in Unity" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "Make your Characters Interactive! - Animation Rigging in Unity"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "Make your Characters Interactive! - Animation Rigging in Unity"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.