Root Motion Explained (Unity Tutorial)

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ค. 2024
  • In this Unity game development tutorial we're going to look at how we can move a character using Root Motion.
    We'll start by adding a complex dance animation to a character. We'll explain the drawbacks of standard animation before looking at how to convert to Root Motion.
    We'll then add a walking animation to the character and set up transitions from dancing to walking and back again.
    Next, we'll look at scenarios where we might not want Root Motion, and then demonstrate how to bake aspects of the motion into the animation when required.
    The project files are available to our patrons here:
    ► / 55728577
    Help support our work:
    ► Patreon: / ketragames
    ► Ko-fi: ko-fi.com/ketragames
    Follow us:
    ► Ketra Games: www.ketra-games.com
    ► Patreon: / ketragames
    ► Twitter: / ketragames
    ► Facebook: / ketragames
    Introduction to Root Motion - 0:00
    Drawbacks of standard animation - 0:37
    Converting to Root Motion - 2:30
    A more complex example of Root Motion - 4:00
    Explanation of problem caused by Root Motion - 8:36
    Baking movement into the animation - 9:00
    Summary - 11:21
    #KetraGames #LearnUnity #UnityTutorials #UnityTips

ความคิดเห็น • 132

  • @meddjihed9108
    @meddjihed9108 2 ปีที่แล้ว +56

    No one explains root motion as simple and clear as you, thank you

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว +4

      Thanks for this 👍😊

  • @yuido
    @yuido 2 ปีที่แล้ว +9

    Great tutorial! You explain everything about the subject in a very detailed and simple way.

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว +1

      Thanks for this comment. Glad you found the video useful 😊

  • @DontCare395
    @DontCare395 2 ปีที่แล้ว

    Thank you for the tutorial,this video bring back my memory that lost from my head for a long time 😊

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Glad it was useful 😊

  • @ricardolicorish2019
    @ricardolicorish2019 2 ปีที่แล้ว +4

    Excellent as usual and useful! Thanks, was hoping you would create a video on Root Motion and can't wait for the next video on using Root Motion to move a character using a Character Controller component

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Thanks for your support 😊

  • @lukecresante
    @lukecresante ปีที่แล้ว +1

    This is an absolutely incredible series, thank you, thank you!

    • @KetraGames
      @KetraGames  ปีที่แล้ว

      Thanks very much for this comment 😊

  • @baroquedub
    @baroquedub 2 ปีที่แล้ว

    It's already been said but just to add my thanks.. wow, another thorough yet easy to understand explanation of those esoteric unity settings. I'd never before properly understood what Bake in Pose actually did. Thank you

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว +1

      Thanks for this comment 😊

  • @omnisepher
    @omnisepher 2 ปีที่แล้ว +1

    Perfect, exactly what I was looking for.

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว +1

      Great to hear 😊

  • @THETV1RUS
    @THETV1RUS ปีที่แล้ว

    Thank you so much for this simple and very important explanation of root motion. This seriously helped me.

    • @KetraGames
      @KetraGames  ปีที่แล้ว

      Great to hear this 😊

  • @challengedollar2880
    @challengedollar2880 11 หลายเดือนก่อน

    such a brilliant explanation. Thank you! Subbed and liked!

  • @filibustero7809
    @filibustero7809 2 ปีที่แล้ว

    Thank you very much for creating this tutorial, this video solves my problem, I'm currently trying to learn how to create a short film in cinemachine and thanks to you I made a significant step forward. Thanks!

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Great to hear this. Thanks 😊

  • @time_null
    @time_null ปีที่แล้ว

    wow this is the best video i have ever found about root motion, thanks

    • @KetraGames
      @KetraGames  ปีที่แล้ว

      Thanks so much for this comment 😊

  • @ItachiX9
    @ItachiX9 2 ปีที่แล้ว

    All your videos are the best! Keep it up!❤

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Thanks for this 😊

  • @alanh441
    @alanh441 2 ปีที่แล้ว +1

    Thank you for such a great tutorial, been searching for ages for why my character kept snapping back to its start position!

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Great, glad it was useful 😊

  • @MySuperSecretName-lh5mh
    @MySuperSecretName-lh5mh 2 หลายเดือนก่อน

    A tutorial that makes even a programmer understand how the heck animations work. Thanks!

  • @playtestdevice9156
    @playtestdevice9156 2 ปีที่แล้ว +5

    Wonderfully explained. I was pursuing this course from udemy unity animation by holostic 3d- penny. But till now they havent told us why the character was going down in y position and how to avoid it. You explained the reason and that too well. Subscribed. Thanks for the hard work

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว +1

      Great to hear. Thanks for this 😊

    • @arunachalpradesh399
      @arunachalpradesh399 2 ปีที่แล้ว +1

      penny already showed in tutorial how to avoid it, by baking y position or rotation. may be you missed and skipped the part. i just came from pennys tutorial

  • @SheepYT
    @SheepYT 2 ปีที่แล้ว

    Incredible video !

  • @Coco-fw1in
    @Coco-fw1in ปีที่แล้ว

    AWESOME EXPLANATION !!!! Thank you very much )

  • @davenirline
    @davenirline 2 ปีที่แล้ว +1

    Awesome! Thank you for this.

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Glad you found it useful 😊

  • @prathameshgaikwad7550
    @prathameshgaikwad7550 ปีที่แล้ว

    believe me I have scratched all the video, but you did explain it, the best in the world, that how root motion works.

  • @evanchen7567
    @evanchen7567 11 หลายเดือนก่อน

    This is incredibly clear 🎉thx

  • @huelea
    @huelea 10 หลายเดือนก่อน

    Thank You so Much. You have helped me a lot

  • @minhtan1675
    @minhtan1675 ปีที่แล้ว

    that super useful, thank you very much 😊❤

  • @ani-gamer320
    @ani-gamer320 2 ปีที่แล้ว +1

    Nice tutorial ❤️👍🏻

  • @MadJack000
    @MadJack000 7 หลายเดือนก่อน

    Cette vidéo est vraiment excellente, j'ai enfin compris comment utiliser le "Root Motion". Explications très claires ! Merci mille fois !
    👍

    • @KetraGames
      @KetraGames  7 หลายเดือนก่อน

      Great to hear, thanks 😊

  • @kingchess64
    @kingchess64 2 ปีที่แล้ว

    very clear explanation love it

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว +1

      Great to hear 😊

  • @user-xc3kl2ky9u
    @user-xc3kl2ky9u 5 หลายเดือนก่อน

    Perfect Tutorial!!

    • @KetraGames
      @KetraGames  4 หลายเดือนก่อน

      Thank you 👍😊

  • @mrearlragnar3187
    @mrearlragnar3187 2 ปีที่แล้ว

    great tutorial, great job

  • @ZiroViI
    @ZiroViI 2 ปีที่แล้ว +1

    Excellent Video! There are no many video tutorials that explain this part of the animation Feature. hoping that you create a video to explain how is the best way to synch 2 animations

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Thanks for this comment 😊

  • @shikhermyv
    @shikhermyv 11 หลายเดือนก่อน

    Thank you!

  • @XpressMusic5530
    @XpressMusic5530 ปีที่แล้ว

    You helped me a lot!

    • @KetraGames
      @KetraGames  ปีที่แล้ว

      Glad it was useful 😊

  • @bigsmoke8344
    @bigsmoke8344 ปีที่แล้ว +2

    Thank you very much♥️

  • @abdoulraoufgambo
    @abdoulraoufgambo ปีที่แล้ว

    thank you so much
    you explain very clairly
    please continue

    • @KetraGames
      @KetraGames  ปีที่แล้ว

      Thanks for your support 😊

  • @noegoleo928
    @noegoleo928 2 ปีที่แล้ว

    Thank u so much for this video!

  • @antonbaidzionak8282
    @antonbaidzionak8282 2 ปีที่แล้ว

    Thank you! I was looking for solution for y offset problem and you gave it

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Glad to hear this 😊

  • @erfanzandi1362
    @erfanzandi1362 ปีที่แล้ว

    Great video indeed.

  • @regularshadow7309
    @regularshadow7309 2 ปีที่แล้ว +1

    awesome thanks

  • @dfghj241
    @dfghj241 2 ปีที่แล้ว +7

    BTW, you can use Root motion with a Generic rig. just make sure you have defined your root bone in the top of the Rig's hierarchy. the root bone should be, as the name implies, the Root of the tree of bones

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว +1

      Thanks so much for this. Really wish TH-cam would allow editing so I could add this to the video 😊

  • @user-zr2cm3bp7j
    @user-zr2cm3bp7j ปีที่แล้ว

    saved me thanks!!!

    • @KetraGames
      @KetraGames  ปีที่แล้ว

      Glad it was useful 😊

  • @m24.editss
    @m24.editss 2 ปีที่แล้ว

    Good i like this video
    Please part2

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Hi, we have a follow up video to this showing how to use root motion with a Character Controller - th-cam.com/video/mNxEetKzc04/w-d-xo.html. Hope you find it useful 😊

  • @myelinsheathxd
    @myelinsheathxd 2 ปีที่แล้ว +1

    thx!

  • @carlinhos048
    @carlinhos048 5 หลายเดือนก่อน

    Ajudou muito, valeu!

  • @qwertz3813
    @qwertz3813 ปีที่แล้ว

    I am working on a 3D battle For Honor like game, and Root Motion seems to be perfect for things like rolling, dashes, sword swinging etc. Thanks!

    • @KetraGames
      @KetraGames  ปีที่แล้ว +2

      Yes, it should work well for those types of movement 😊

    • @qwertz3813
      @qwertz3813 ปีที่แล้ว

      @@KetraGames I want to also mention that you can control root motion by script, so you can use root motion for some animations and script physics for other. Its a cool feature someone might be looking for.

  • @oceancx4133
    @oceancx4133 2 ปีที่แล้ว +1

    your voice is full of rhythm

  • @ElectRocnicOfficial
    @ElectRocnicOfficial ปีที่แล้ว

    I want to have my usual animations for the rig and keyframes instead of the C# script for root movement. How can I add keyframes (I don't want them inside the animation states, because this should be above all animation states)?

  • @operationfrogurt
    @operationfrogurt ปีที่แล้ว

    Great video! When I create custom animations though, the green and red lights for loop match don't appear. How can I get those to appear for my own animations?

  • @roxannafabiolastefaniuc3606
    @roxannafabiolastefaniuc3606 11 หลายเดือนก่อน

    thank you for explaining the root motion. I have a question about it. When i activate root motion on animator on a 3D character. its sliding, especially if the terrain is higher.. why is that? how can i fix this please? do you have another video about this issue?

  • @starplatinum3305
    @starplatinum3305 7 หลายเดือนก่อน

    How about a jump animation ? And if i wanna change speed i have to speed up the animation ?

  • @prathameshgaikwad7550
    @prathameshgaikwad7550 ปีที่แล้ว

    next time please make video on navMesh agents and how to use root motion on them.

  • @saniyakhansaniyakhan9076
    @saniyakhansaniyakhan9076 4 หลายเดือนก่อน +1

    Can you make a video on Joystick. I really want it

  • @LordCritish
    @LordCritish 2 หลายเดือนก่อน

    Eeeeexcellent! And I like the British accent.

  • @farianderson168
    @farianderson168 ปีที่แล้ว

    is this root motion achievable with a simple cube animated with timeline and without any armature?

  • @RuperDesarrollo93
    @RuperDesarrollo93 17 วันที่ผ่านมา

    Hii! im getting this error when i try to select my avatar into the humanoi animation i want to use :
    File 'HeavySword_b_move' copied Avatar Rig Configuration mis-match. Transform hierarchy does not match:
    Transform 'Hips' for human bone 'Hips' not found
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    hips are okey in both avatars configurations... if u or anyone can help me i ll apreciatte a lot...

  • @parriedswoosh
    @parriedswoosh 2 ปีที่แล้ว

    have you come across characters animations being changed when imported from mixamo to unity; for example, the running animation has the player run but nothing rotates as it should, instead you see the head rotating in place. it looks okay, but there is a difference, the rotation is like moved/or fixated in a way that the whole body doesn't move the same way, only parts of it.

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Hi, it can look like this if the root motion isn't being applied properly. Have you got the 'Apply Root Motion' checkbox ticked in the Animator component of the character?

  • @edhalsim
    @edhalsim 11 หลายเดือนก่อน

    Excellent video. One question though: How can I make it so the character doesn't walk through objects? I tried adding a capsule collider, but that didn't do anything.
    Also, when you mention a future video, please include it at the end so it can be clicked on, or a link in the description. Thanks again!

    • @KetraGames
      @KetraGames  10 หลายเดือนก่อน +1

      Hi, try adding either a CharacterController component or a Rigidbody component and that should stop it walking through walls.
      Thanks for pointing out the missing link to the future video. I've now included it at the end 😊

  • @Legend-tb2vs
    @Legend-tb2vs 3 หลายเดือนก่อน

    My character is above the ground while performing the animation i did bake into pose but still it just starts from there pls help

  • @utsavsingh1128
    @utsavsingh1128 2 ปีที่แล้ว

    Hi Ketra, thanks for the video and great explanation. But I have a problem. Baking animations options are not available in some asset animations downloaded from the asset store but from Mixamo it's there. After searching over the internet a lot, I am still not able to understand why the "Bake into Pose" option is not shown. But it is shown for some assets like those downloaded from Mixamo. All rigs are Humanoid.
    After the jump, my character keeps going below the floor.
    Please guide

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Hi, the first thing to check is that the apply button has been clicked on the Rig tab after changing to Humanoid. Unity lets you switch to the Animation tab without applying the changes and I've been caught out by that a few times.

  • @gmangman123
    @gmangman123 ปีที่แล้ว

    when the export fbx to unit animator says: (none) motion what is this?

  • @Montazeran8
    @Montazeran8 2 ปีที่แล้ว

    ❤❤❤

  • @redeye1k
    @redeye1k 2 ปีที่แล้ว +4

    first , ty for the tips!

  • @yusufkoraycan4607
    @yusufkoraycan4607 2 ปีที่แล้ว

    Love u

  • @embashosho6080
    @embashosho6080 2 ปีที่แล้ว

    Great tutorial. One question. I'm trying to apply root motion for an animal, say a dinosaur, can I still use the humanoid option? The animal keeps walking in the same position

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Hi, you would be better off using the generic option for animals. You can still use root motion though. You just need to create an avatar from the model as you would for humanoid, and set the 'Root node' to the root bone.
      Hope that helps 😊

  • @fabianobersovszky6987
    @fabianobersovszky6987 ปีที่แล้ว

    As far as i know, root motion is not recommended in some cases. Can i use root motion for a third person cover system for a MP game?

    • @KetraGames
      @KetraGames  ปีที่แล้ว

      Hi, yes, you can use root motion for a third person cover system. If you have animations with the motion included then root motion is the way to go. If they don't have motion then you'll have to update the position in a script. Hope that helps 😊

  • @nickfai9301
    @nickfai9301 ปีที่แล้ว

    Hi, I bought Low Poly Characters Mega Pack from Unity Assets Store. The characters only can walk or run at a same spot. Is it because the characters do not have root motion?

    • @KetraGames
      @KetraGames  ปีที่แล้ว +2

      Hi, some animations contain root motion and some are just in place. If you have in place animations then you'll need to move the character yourself via script. Hope that helps 😊

    • @nickfai9301
      @nickfai9301 ปีที่แล้ว

      @@KetraGames Thanks.

  • @Danyu91
    @Danyu91 2 ปีที่แล้ว

    the walk animation root motion seems to make my character slowly move down into the ground, no matter what check i did with the tut.
    my solution was to just add a collider and rigid body.

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว +2

      Hi, if you bake the Root Transform Position (Y) into the pose then the animation shouldn't affect the Y position. Glad you found a solution though 😊

  • @Husmanmusic
    @Husmanmusic 2 ปีที่แล้ว

    Hey Ketra, awesome videos on rootMotion. I got it to work awesome for my player character! However, i just can’t get it to work properly for my npcs, which are navemeshagents who use .setposition. Could you perhaps do a video/explanation on how to use rootmotion on npc’s? Thanks for what you do!

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Hi Husman, to get it to work for a navmeshagent you need to implement the OnAnimatorMove method. This will allow you to set the speed of the agent to the root motion. Something like this should get you started
      void OnAnimatorMove()
      {
      agent.velocity = animator.deltaPosition / Time.deltaTime;
      }
      Hope this helps for now. We'll definitely look at doing a video on this in the future. Thanks for the suggestion 😊

    • @Husmanmusic
      @Husmanmusic 2 ปีที่แล้ว

      @@KetraGames Hey Ketra, thank you for getting back. I tried that method, but for me the navmesh agent than just walks straight forward(because the rootmotion walking animation is moving forward) So the character when using agent.SetDestination will not go to the destination that i set. I think the issue is that the rootmotion is overriding the rotation that needs to happen to get to its destination. It's been quite puzzling.

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว

      Hi Husman, sorry the previous code I sent wasn't quite right. You need to change the speed not the velocity. Something like this
      agent.speed = (animator.deltaPosition / Time.deltaTime).magnitude;
      That way it won't override the direction.

    • @Husmanmusic
      @Husmanmusic 2 ปีที่แล้ว

      @@KetraGames Ah thank you, will check that out!

    • @Husmanmusic
      @Husmanmusic 2 ปีที่แล้ว

      @@KetraGames That totally did the trick, I have no clue what that line of code means but it works like a charm haha! (patiently waiting for the next awesome video by you).

  • @lousadascp3208
    @lousadascp3208 2 ปีที่แล้ว

    Hello, should we use root motion when we have a lot of animations and we wanna use a 2d blend tree?

    • @KetraGames
      @KetraGames  2 ปีที่แล้ว +1

      Hi, when you have lots of blended animations it is particularly difficult to match scripted movement with the animation, so I would say that root motion would probably make things easier.

    • @lousadascp3208
      @lousadascp3208 2 ปีที่แล้ว

      @@KetraGames thank you so much for all your work and the time you spend answering to people :)

  • @saniyakhansaniyakhan9076
    @saniyakhansaniyakhan9076 4 หลายเดือนก่อน +1

    My Root Motion is not working , what should I do. PLZ REPLY

    • @saniyakhansaniyakhan9076
      @saniyakhansaniyakhan9076 4 หลายเดือนก่อน +1

      I SOLVED it by downloading the animation from Mixamo.Before I was using animations from an Asset

  • @unrealdevop
    @unrealdevop ปีที่แล้ว

    I wish someone would tell Animators that Root Motion has the keyword ROOOOOTTTT for a reason....there is a reason they don't call them HIP MOTION ANIMATIONS

  • @ninjedi6710
    @ninjedi6710 ปีที่แล้ว

    but but but. why does root motion add gravity to my character?

    • @KetraGames
      @KetraGames  ปีที่แล้ว +1

      Hi, if you're using Root Motion with a Character Controller then gravity will be added by default. You can override this using OnAnimatorOverride docs.unity3d.com/ScriptReference/MonoBehaviour.OnAnimatorMove.html. Hope that helps 😊

  • @BobTheSkateboard01
    @BobTheSkateboard01 2 ปีที่แล้ว

    Your character isn't an ambiturner

  • @dudedudedudedude5381
    @dudedudedudedude5381 ปีที่แล้ว

    Thank you!

  • @munyunu
    @munyunu ปีที่แล้ว

    Thank you!