Using Root Motion In Godot 4!

Поділитися
Вставка
  • Опубліковано 19 чер 2024
  • Subscribe and learn more from me about Game Development and Programming!
    In this video, we talk about how to use root motion to make a character controller!
    RESOURCES
    Source: github.com/finepointcgi/RootM...
    Creating A 3d Character Controller: • Creating a 3D Characte...
    BE MY FRIEND:
    🐦Add me on Twitter: / finepointcgi
    Check out my Website: finepointcgi.io/
    Trello of Upcoming Tutorials: trello.com/b/cJWPaVyV/godot-t...
    You can support me on Patreon: / finepointcgi
    Hang Out with the Guys on Discord: / discord
    TIMESTAMPS
    00:00 - Start
    00:58 - Lets Talk About Mixamo! (Again)
    04:03 - Converting Them Into Root Motion
    05:20 - Using the Mixamo to Godot Tool
    09:26 - Getting Into Godot
    11:51 - Setting Up Our Root Motion in Godot
    13:55 - Setting Up Our Blend Shape Walking
    16:25 - Setting the Scene
    17:54 - Creating Our Camera Controller
    23:24 - Coding Our Character Controller
    28:07 - Coding Our Root Motion
    39:44 - Getting Our Character To Focus on a Direction
    46:19 - Conclusion
    MUSIC
    Music provided by TheRelaxedMovement.
    Check it out here: / therelaxedm...​
    HASHTAGS:
    #Godot4 #character #gamedev
    ABOUT MY CHANNEL:
    I've been a software developer for over 7 years. I've worked in the game industry for 3 of those years. This channel is used for news on the gaming\programming industry and for tutorials for game\programming development.
    Using Root Motion In Godot 4!

КОМЕНТАРІ • 86

  • @dabajabaza111
    @dabajabaza111 Рік тому +1

    Another great tutorial.
    Thank you so much.

  • @JayYeasmin
    @JayYeasmin Рік тому +7

    Hope you're doing well friend! Thanks for the awesome vid!

    • @FinePointCGI
      @FinePointCGI  Рік тому +4

      Hey thanks for the tip! I really appreciate it! I am doing well work has been busy but im getting though my list of videos one by one!

  • @mrkaratedo
    @mrkaratedo Рік тому +2

    Excellent congratulations!

  • @Soroosh.S83
    @Soroosh.S83 8 місяців тому

    😮 omg thank you so much U solved my problem I wanted my animation walk but not reset so I have to use animation tree
    Thank you so much
    Unforchanetly not much people were talking about this
    Edit: It didn't solved my problem

  • @gamestervirus
    @gamestervirus Рік тому +2

    Thnx brother didn't know that u will actually create a vid on it. and also can u suggest how to implement jump using root motion cuz am stucked there

    • @FinePointCGI
      @FinePointCGI  Рік тому +4

      Of course! All of my videos (well most) are viewer suggested!

  • @Nipah.Auauau
    @Nipah.Auauau Рік тому +9

    Since the fixed IK system has been put off indefinitely, could you do a video on using IK with the system currently in place? Some examples could be a person aiming a gun or properly placing their foot on terrain.

    • @FinePointCGI
      @FinePointCGI  Рік тому +7

      I think that would be alot of fun! Ill look into it!

  • @NexusBaum
    @NexusBaum 9 місяців тому

    Nice!
    But how do I add an animation after all of this? E.g. when I extend my movement system later.

  • @victorhugoleme6772
    @victorhugoleme6772 9 місяців тому +1

    I'm facing an issue where my animations all got offset on the z axis. It works nicelly in Blender, but if I export it as glb or save it straigth to godot, the animations get screwd, the run animation makes the char just disapear at the horizon lol
    the only difference i see is the skin and the Hip bone is called "mixamorig1:Hips". I've changed the name in the addon panel, and so on..
    DO you know how can i solve this problem? ty so much

  • @vaner-
    @vaner- Рік тому +2

    I think you should try to place a grid texture on the ground and try running your game again. The character's foot slides and doesn't move fast enough at all, compared to how it shows up in the RootMotionView, or using the equivalent transform3d in godot 3.

    • @andrechism
      @andrechism Рік тому +1

      I fixed it by changing the AnimationTree's Process Callback from 'Idle' to 'Physics.'

  • @flyingjudgement
    @flyingjudgement 8 місяців тому +1

    I guess with each blender update the import tool break. What is your blender version ?

  • @alexongg
    @alexongg 5 місяців тому +1

    The main issue I'm having is that blender is only exporting the hips bone. It seems like the plugin is no longer correctly generating the root bone in the latest blender version. Or am I missing something?

  • @AxZelAnimations30
    @AxZelAnimations30 7 місяців тому

    What if I want to make a root motion in Godot itself? Like using Node3D or just the center of something?
    I want to use Root Motion in Sprite3D to be exact.

  • @fergusdrummyt2342
    @fergusdrummyt2342 19 днів тому

    you should do a tutorial like this but for first person to prevent gun clipping and sstuff like that

  • @voc007
    @voc007 Рік тому +1

    Thanks alot, keep up the great work! However after completing the tutorial, if you turn on shadows, and run for a while the character is slightly going up and up off the grid.... ?

    • @andrechism
      @andrechism Рік тому +1

      That's because the character doesn't have gravity yet

  • @user-bi1lv7rh1n
    @user-bi1lv7rh1n Рік тому +2

    I was doing a project and really needed help with root motion, 10/10 tutorial man 👍. When do you plan to do the C# version, since C# is just the better language? :)

    • @FinePointCGI
      @FinePointCGI  Рік тому

      I hope to get it out friday or saturday!

  • @RandomGuyyy
    @RandomGuyyy Рік тому

    When I exported from Blender only the currently selected animation in the Action Editor came along with the GLTF export.

    • @lukevost
      @lukevost Рік тому

      Select character mesh, armature, in export select: glTF Binary (.glb), and Include -> Limit to -> Selected objects

  • @yudi-azvd
    @yudi-azvd Рік тому +1

    Hey great video! but I have a doubt
    I noticed in the end the character snaps when changing animations. Is it possible to mix Root Motion and the techniques presented in your video "Creating A 3d Character Controller" to make transitions between animations smoother?

    • @FinePointCGI
      @FinePointCGI  Рік тому +3

      Yes! This is supposed to augment that technique so any of the blending or things like that will work!
      I should have specified that lol

  • @vettie
    @vettie 7 місяців тому +2

    This tool works well in theory but it's broken currently. Please update if you can.

  • @user-ns1nn6nl3j
    @user-ns1nn6nl3j Рік тому

    Hey when you set up your BlendSpace2D, I noticed your implementation has some weird behavior I'm encountering, but you didn't really touch on it. When you are about half way between walk and sprint, the walk and sprint animations become out of sync and deconstructively interfere, creating a skipping like motion. This happens when walking on a 45 degree angle as well, since the forward component is about half way between walk and sprint. Any thoughts on how to overcome this? It is sneaky when developing on key and mouse

    • @FinePointCGI
      @FinePointCGI  Рік тому

      That's interesting! I honestly haven't tried it with a controller so now I'm going to have to try it and look at it..

    • @user-ns1nn6nl3j
      @user-ns1nn6nl3j Рік тому +2

      @@FinePointCGI my mind has been on this issue in the background for the last 20 hours so here is what I found:
      - getting your animation loops for walking and running to be roughly the same number of frames helps sometimes?
      - getting you animation loops for walking and running to start stepping with the same leg in the loop helps sometimes?
      - if you do those two things make sure to enable the "sync" checkbox in the BlendSpace2D so it makes a difference
      if you have a sprint button you can clamp the blend position to stay within the walk region of the blend space
      another nice touch I found is to use move_toward() or some other interpolation function to smoothly move the blend position. It helps for digital inputs like keyboards so the character slowly starts moving. it also helps transition from sprinting to walking
      just a brain dump after my working on a similar system!

  • @Yuri77711
    @Yuri77711 5 місяців тому

    How to add new animations/remove unused ones later on? I tried to re-export blender file with new set of animations into godot folder and clicked re-import on .dlb file in godot, but they don't show up in animation tree.

    • @leoscave6728
      @leoscave6728 5 місяців тому

      I hand to drag the character file back into the scene to get the new aims. Then add it to the library of the original. Hopefully there is an easier way.

  • @saitmarasloglu9403
    @saitmarasloglu9403 Рік тому +1

    How everything works perfectly for you.
    I added root bone and looks like my animation comes in 1/100 size. Cant see animation because root bone is too big!

    • @FinePointCGI
      @FinePointCGI  Рік тому +1

      Look at your export settings see if it has something to do with scaling not being applied.

  • @bongo6_462
    @bongo6_462 11 місяців тому +1

    If I dont have a root bone, do you have a other way to force my model to stay in 1 place, I messed up the root place thing in blender. Im new tho

    • @FinePointCGI
      @FinePointCGI  11 місяців тому +1

      No you must have a root bone to do root motion unfortunately!

    • @bongo6_462
      @bongo6_462 11 місяців тому

      @@FinePointCGI Thanks for the response :), the issue im having is that one of my animation is too far back because in blender i set the "middlepoint?" too far forward. So im trying to change the position of the mesh BUT ONLY for that speicific animation. Is that possible?

    • @FinePointCGI
      @FinePointCGI  11 місяців тому

      You would need to rekey the hip bone if you're using miximo and that would hopefully move all of your stuff forward..
      You could also try selecting whichever bone is your base that moves all of your bones and just set that as the roopon and it might work but then your character might can't left and right so you might have to go in and get rid of all the rotation of that bone

  • @joshuaanderson6609
    @joshuaanderson6609 Рік тому

    I'm wondering why you don't have the camera controller just as a child of the character instead of setting it's location to the character location in script?

    • @FinePointCGI
      @FinePointCGI  Рік тому

      I prefer to seperate them because it will give me more flexability in the future. For instance if I wanted to add in a "photo mode" or something.

  • @MrMikhead
    @MrMikhead 6 місяців тому

    Great tutorial...Im using synty characters, and have managed to follow along up until you add the rootmotionview node, and I get no movement....its animated, but its not moving....I managed to put a root bone on the character, and on the animation library Im using (action adventure), and the animations are animated and moving in blender, but in Godot, its just animated, no movement.....any idea why? Cheers!

    • @KyleRassweiler
      @KyleRassweiler 5 місяців тому

      Are you using the mixamo rig with the synty characters? I've found that I needed to add a bone map using the default humanoid profile when importing mixamo to godot.

    • @MrMikhead
      @MrMikhead 5 місяців тому

      yes, I am using the mixamo skeleton...I found it too dificult to animate all the bits at once though, and Im making an RPG, so need to swap out parts, so Im currently playing with mounting all the static meshes as you would a weapon....doesn't morph with the animations anymore, but its meh....that'll do for now :)
      @@KyleRassweiler

    • @KyleRassweiler
      @KyleRassweiler 5 місяців тому +1

      @@MrMikhead If you export the meshes without the armature they don't seem to export their skin data and won't animate in godot... I'm doing the same as you and found that I need to export everything to "models.glb" then export only the armature to "armature.glb"

  • @michaelsimon9550
    @michaelsimon9550 Рік тому +1

    Nice Work!
    The BlenderAddon doesn't seem to create a root bone for the armature with the skin (Blender 3.4).

    • @FinePointCGI
      @FinePointCGI  Рік тому

      I'll have to take a look... I just recently updated it to handle crouching animations properly

    • @michaelsimon9550
      @michaelsimon9550 Рік тому

      @@FinePointCGI While you at it - some animations don't seem to get imported. in my case this happend w/ "strafe walk" (left and right), walk and idle straight from mixamo.

    • @FinePointCGI
      @FinePointCGI  Рік тому

      Can you throw those up into a Google drive so I can take a look at it on my end.. I haven't had any issues with any importing with my latest version on my github though who knows

    • @michaelsimon9550
      @michaelsimon9550 Рік тому

      @@FinePointCGI sure, how do you want me to you?

    • @FinePointCGI
      @FinePointCGI  Рік тому

      drive.google.com/drive/folders/1lbIi1eXJsySOTS0GhTVurwBHeAJagZ43?usp=share_link
      Upload it to that. Ill be closing that link down in a few hours

  • @ConnorSaxe
    @ConnorSaxe 6 місяців тому +1

    I'm using Blender 4.0, and whenever I try to import a folder with multiple FBX animations through the Mixamo Root add-on, it only imports the first animation in the list, and I can't figure out why. Any ideas?

    • @InternetMenace8526
      @InternetMenace8526 3 місяці тому

      Same here, did you manage to get it working?

    • @enricosanti7627
      @enricosanti7627 3 місяці тому

      @@InternetMenace8526try rename mixamorig:Hips to mixamorig1:Hips (add the 1) under the Hip Bone Name of the plugin it looks like Mixamo has renamed the bone so its not finding the right bone. I just did that and I was able to import all the animations fine

    • @_keerp
      @_keerp 5 днів тому

      @@InternetMenace8526 I had that issue in 4.1, but I had checked the " remove prefix" option, when i unchecked it and tried again, it imported them all.

    • @InternetMenace8526
      @InternetMenace8526 4 дні тому

      @@_keerp I managed to get it importing them all by using the 3.something version of Blender. I'll try your method next time, thanks.

  • @dabajabaza111
    @dabajabaza111 Рік тому +1

    For some reason, importing animations using the addon doesn't work with the Mannequin model from Mixamo.

    • @FinePointCGI
      @FinePointCGI  Рік тому +1

      Are you getting any errors? Ill have to look more indepth on this.

    • @dabajabaza111
      @dabajabaza111 Рік тому

      @@FinePointCGI I'm not getting any errors. It just imports a lone armature with no mesh or animations whenever I try to use it on something with the Mannequin model.

    • @FinePointCGI
      @FinePointCGI  Рік тому +1

      I'll dig into it and see what's going on something seems to be up

    • @AetherPowered
      @AetherPowered 11 місяців тому +2

      @@dabajabaza111 You need to use mixamorig1 (the 1 was missing) in both the nameprefix and for the hip bone name, and it should work. At least it did for me.

    • @dabajabaza111
      @dabajabaza111 4 місяці тому

      @@AetherPowered Thank you! This solved the issue for me.

  • @DirkVantas
    @DirkVantas Рік тому

    The insert root options just scales all my armatures down and changes their rotation randomly

    • @FinePointCGI
      @FinePointCGI  Рік тому

      Now that sounds like a bug! Id lodge one with the plugins git and see if they have any ideas why. But something to check make sure all of your bones have there scale and rotation applied. It can fix funky behavor

  • @THEDEVBOIS
    @THEDEVBOIS Місяць тому +1

    if your gonna do a ground its always better to have everything in order not criticizing but for the ones who are new youll start gettin a headache if you dont set things in order. some nodes cant go before or after other nodes. so if you set a ground do it like this to stay organized. click on 3D scene and name it world> right click add child node and add static body3D> right click static body add a child node and add mesh instance3D> under mesh instance on the right side of your screen click on empty and choose a cube> click on the small cube picture and scale the x to 200 and z to 200> scroll down to transform and on the Y position type in -0.51 this will lower the platform just beneath the X axis> now go back to static body add a child node and add the collision shape3D> do the same thing as you did for the mesh instance 3D with scales of 200 on the X and 200 on the Z and -0.51 on the Y position under transform> now since you renamed the scene “world” when you save this scene as tscn itll automatically have it name as world.
    small edit: make sure you set the collision shape 3D to 1 under the transform section, so position on Y is 1 this will put the character right above the floor perfectly

  • @noahchase7854
    @noahchase7854 9 місяців тому

    hm I'm not getting the root bone, tried over ten times and followed this perfectly

    • @enricosanti7627
      @enricosanti7627 3 місяці тому +1

      Maybe you figure it out but in case you have not try rename mixamorig:Hips to mixamorig1:Hips (add the 1) under the Hip Bone Name of the plugin it looks like Mixamo has renamed the bone so its not finding the right bone.

    • @noahchase7854
      @noahchase7854 3 місяці тому

      @@enricosanti7627 thanks!

  • @computercodelearning
    @computercodelearning 6 місяців тому

    is that godot language?

  • @bishnuprasadpahari3780
    @bishnuprasadpahari3780 Рік тому +3

    first

  • @Ceisriel
    @Ceisriel 11 місяців тому

    You can entirely remove the need for a root motion by using call method tracks for either signals or functions in the animations, you are gonna need to use call method tracks for other things like combat/destroying tiles/building anyway so might as well

    • @SoulGuitarMetal
      @SoulGuitarMetal 10 місяців тому +1

      You must be refering to animation events such as playing a sound when on foot contact on the floor. That has nothing to do with root motion.

    • @Ceisriel
      @Ceisriel 10 місяців тому

      @@SoulGuitarMetal that's why I said you don't need root motion.

  • @damianromero1383
    @damianromero1383 Місяць тому

    @ _physics_process(): Node not found: "LookAt" (relative to "/root/Node3D/Node3D/SpringArm3D/Camera3D").

    • @FinePointCGI
      @FinePointCGI  Місяць тому

      Check your node path and verify its in the right location judging by what im seeing you may have an extra Node3D in your path.

  • @BatmanFailedSociety
    @BatmanFailedSociety Рік тому

    Hello, can you make a video about how to make a 3d character move to where you tap on the screen in 3D? Like Dota 2.
    I really want to make a mobile game but I don't know how to code it. 🥲

    • @FinePointCGI
      @FinePointCGI  Рік тому

      I have a video on how to use the 3d navigation system in Godot 4 that should get you going if you combine the character controller animation portion and that tutorial it should get you relatively close.
      I'll link it when I get home.

    • @BatmanFailedSociety
      @BatmanFailedSociety Рік тому

      @@FinePointCGI thank you

    • @FinePointCGI
      @FinePointCGI  Рік тому

      ua-cam.com/video/KT06pv06Q1U/v-deo.html
      Granted it's in GD script so if you need I can always look at doing a c# version