Using Root Motion in Godot 4 C#

Поділитися
Вставка
  • Опубліковано 26 чер 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:44 - Using Mixamo To Get Our Animations
    03:55 - Processing Our Animations and Adding Root Motion in Blender
    09:22 - Getting Into Godot and Setting Up Our Character
    11:27 - Working With RootMotion Using Animation Tree
    15:28 - Setting Up Our Player Character
    17:00 - Creating Our Scene
    17:42 - Creating a Camera Controller
    19:52 - Coding Our Camera Controller
    27:30 - Capturing Our Mouse Input
    28:26 - Coding Our Root Motion
    35:50 - Talking About Dividing a Vector 3 by Float
    38:36 - Rotating Our Character Based Off of Our Root Motion
    43:26 - Fixing More Small Bugs
    43:48 - Adding in a Smooth Rotation
    45:23 - Fixing Rotating to Z 0
    45:46 - Getting Look at To “Focus In” on a Thing
    49:12 - Yay More Bugs
    51:06 - Recap and Outro
    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!

КОМЕНТАРІ • 23

  • @chrismcpherson7582
    @chrismcpherson7582 10 місяців тому +2

    Protip, when youre trying to use Godot specific properties, like the "parameters/StateMachine/conditions/Moving", you can just right click that property in the godot editior and copy the path

    • @FinePointCGI
      @FinePointCGI  10 місяців тому +2

      I always forget thats a thing!

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

    big thank you for this, i thought you only upload root motion tutorial on godot language 😂

  • @JasonMorelandDigitalrecline

    Excellent tutorial Would love to see a ARPG setup for 3d isometric view controller like diablo or path of exile, having issues tryiing to set one up from miximo animations.b

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

    I'm struggling with custom resource in C#, it finally works, but I have no reason to go on, they should really add a note: C# support is not good enough to make a game now, just for fun only! And the performance on MacOS is totally a mess, please wait until we come up a new version in the future! Totally a waste of time.
    In my opinion, if you want to make a game in C#, go with Unity, if you want to make a game in Godot, choose GD Script.

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

    3d character movements with mobile control and joystick tutorial video create please

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

    Thank you but can irequest can you do a tutorial on making a Character Selection in 3D?

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

      Do you mean like street fighter or like skyrim?

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

      @@FinePointCGI I am creating a maze game and I want a user choose a player

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

    thank you godot root motion video
    I followed the same as in the video and exported from blender to glb
    But there is only one animation action.
    same as godot4.0 , 3.5.2

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

      When you go in the action editor do you have multiple actions?
      If you do then check your export settings over in animations make sure that's getting exported.
      If not then odds are the animations didn't load properly in some way you'll have to reload them

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

      @@FinePointCGI
      Thank you very much for the quick reply
      I have tried various things about this problem
      Is it a Godot version issue or is it because I don't know Blender well...
      in conclusion..
      The first Bleder version I followed was version 2.9.2.
      When I exported with it, the AnimationPlayer contained only the last action selected in Blender. I tried various options but this did not fix the problem.
      In the end, when I installed the latest Blender 3.5 and repeated the same operation, I was able to get the desired result.
      In case you go through the same trial and error as me, I will leave the contents ^^;;

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

      @@sjk7033 Im glad you got it working!

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

    i have problems installing the addons, somehow it didnt show the mixamo root options

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

      ill end up using the richardperry addons

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

      Can you link that I would love to look at it especially if it's a better option!

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

      @@FinePointCGIsorry for the late reply, i've been replying but my comment keep missing, here is the the link you asked

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

      @@FinePointCGIgithub RichardPerry/Mixamo-Root

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

      @@FinePointCGIsomehow the RootMotionView acting crazy, here is the clip youtube /watch?v=xw4wT0DwvdY , probably because the addons that ive been using or maybe there is some other way around that goes wrong, ive been following your tutorial but im still figuring out how to set it up properly, im using godot 4.21, thanks for the help:)

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

    Yeah something is wrong with this solution. Gravity doesn't gick in properly and my character moves super slow. I've tried to scan through your code to find if we did something different. But it's not on GitHub. Maybe I missed something in the settings. Idk

    • @reeds7777
      @reeds7777 2 місяці тому

      Gravity does not work because the code presented here overrides it at the end of PhysicsProcess. To avoid this, you can set only the X and Z components to the new values, and just leave Y as it is (because gravity is applied at the beginning of the script, unless you deleted that bit). If you deleted it, it looked something like:
      // Add the gravity.
      if (!IsOnFloor())
      velocity.Y -= gravity * (float)delta;
      // Handle Jump.
      if (Input.IsActionJustPressed("ui_accept") && IsOnFloor())
      velocity.Y = JumpVelocity;
      The character moves slowly because (from what I can tell), the GetRootMotionPosition function returns the delta per RENDER frame, and not per physics frame. There might be a way to change that, not sure. But to fix it, I moved the setting of velocity out of PhysicsProcess and into Process, where I set the X and Z of velocity to be the result of something like:
      (Transform.Basis.GetRotationQuaternion() * _animationTree.GetRootMotionPosition()) * (1f/(float)delta)
      Hope this helps anyone else who comes across this, as I know the comment is a year old lol.

    • @esmeraldus3906
      @esmeraldus3906 25 днів тому

      I'm getting this as well. Something to do with the velocity not being set correctly. I fixed it by multiplying the velocity by 2.6. But that seems like a bandaid solution to me, and I really wish I could figure out what's causing it

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

    I installed RichardPerry's plugin, did everything step by step, root bone does not get created unlike how it does in 7:45