Realistic Foot Placement - Foot IK Tutorial in Godot 3.2

Поділитися
Вставка
  • Опубліковано 27 лис 2024

КОМЕНТАРІ • 56

  • @bitmammothOG
    @bitmammothOG 3 роки тому +12

    omg lol I have been searching this entire last week for info on this thank you so much for teaching us how it works :)

  • @sanyi9667
    @sanyi9667 3 роки тому +5

    Thank you so much for this tutorial, I was looking for a foot IK tutorial for months. Zylann made a demo video but I was too inexperienced to figure it out. This tutorial is more than welcomed!

    • @wojtek_pe
      @wojtek_pe  3 роки тому

      Hi, if I remember correctly, the thing that Zylann made was a totally procedural approach without animation blending. Probably it looks better and is more professional. My solution only sticks foots to ground in predefined way :D However it works mostly ok and is extremely easy.

  • @RTSFan1337
    @RTSFan1337 3 роки тому +4

    Thanks I've waited for this :)

  • @sigitsatriap6505
    @sigitsatriap6505 3 роки тому +2

    Nice video, finally someone make video about this with godot, thanks !

  • @javisartdesign
    @javisartdesign 3 роки тому +2

    thanks man! I watched a similar approach using Unity. I am trying to inference the feet movement using the velocity of each foot and also placing the hips so the boddy adjust to steps correctly. This approach is very handy neverless.

    • @wojtek_pe
      @wojtek_pe  3 роки тому +1

      Hi! This is really a basic approach which could be done in 15 minutes, so of course it's lacking many nice features. If you made something more sophisticated I would gladly hear about it! I didn't find anything on YT about IK foot system for Godot so I made this simple video. I am also a beginner in this topic.

    • @javisartdesign
      @javisartdesign 3 роки тому

      @@wojtek_pe it's awesome what you're doing with Godot🙂

  • @BrainAirways
    @BrainAirways 3 роки тому +6

    I think your main issue why it looks "janky" is model itself or your rig was setup incorrectly. You can see it clearly around calf area. Calf is rotated towards outside while foot remains straight. It is very noticable when character is standing still.

    • @wojtek_pe
      @wojtek_pe  3 роки тому +1

      Hi! The main reason it looks like that it's because I simplified a "look at" vector for feets in IK system. Right now it basically takes a front vector of character and copy it. For better results we should copy other bone orientation in XZ axis, or we should store feet orientation in animation resource somehow (maybe just by rotating "interpolation" Position3D node and adding this value in code). It's definitely on my todo list. For the sake of this video I wanted the code to be really simple, I think that anyone can improve it from here.

    • @BrainAirways
      @BrainAirways 3 роки тому +1

      @@wojtek_pe if that is the case in my opinion easiest way would be to combine IK with FK. Instead appling rotation to foot, apply it to calf bone. It should then rotate foot together with calf bone. At least if Godot bone system works 1:1 how Blender bone system works.
      Another idea would be to move pool target for knee to face character forward vector (this would need to be tested to see if it will be janky).

    • @wojtek_pe
      @wojtek_pe  3 роки тому +2

      ​@@BrainAirways Hi, I was experimenting with some ideas but in the end I probably try to add another position 3d for magnet value. Actually the skeleton is something like that: Hips -> leftUpLeg -> LeftLeg -> LeftFoot -> LeftToeBase, I can't modify Hips from both Ik systems and modifing ony LeftUpLeg and LeftLeg doesn't give desired result . I was hoping that somehow I could read original bone position and orientation form animation in Godot and just override it slightly but it doesn't seem that this is possible. The second solution you proposed is actually the thing I am showing on the video. It seems sometimes weird, especially in a idle position because rotation of bones inside ik system arent modified beside the tip bone. I will experiment with more and hopefully I will have something to show on my next devlog

  • @fixurlife
    @fixurlife 3 роки тому +2

    Thank a lot for this very useful tutorial!

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

    Wonderful, thank you very much

  • @Tdoshok
    @Tdoshok 3 роки тому +4

    Excellent tutorial, but I can't read the character.gd script at all on my monitor. You might want to either increase font size while recording or link to a git repo for your scripts in these videos

  • @DonatemangaCom
    @DonatemangaCom 3 роки тому

    Really good tutorial, many thanks!

  • @jeffreygangwisch448
    @jeffreygangwisch448 3 роки тому +1

    Excellent tutorial. Thank you.

  • @yellowsock8791
    @yellowsock8791 2 роки тому +1

    It works!! but how can I stop the legs from being bent?

  • @den007trof
    @den007trof 3 роки тому +1

    Thank you very much. Great video

  • @AniketSingh-hr8mi
    @AniketSingh-hr8mi 3 роки тому +1

    nice video tutorial. keep it up!

  • @b.p.7875
    @b.p.7875 11 місяців тому

    Great tutorial

  • @JorgeRosa
    @JorgeRosa 2 роки тому

    Thank you!

  • @sanyi9667
    @sanyi9667 3 роки тому +1

    so on trying to implement it my characters legs go up. How did you tweak those parameters(minmax_interpolation, foot_offset, ik_raycastheight)? I saw my characters legs are more sensitive when moving the target_left and target_right. Any thoughts on this?

    • @wojtek_pe
      @wojtek_pe  3 роки тому +1

      Hi, I am not sure why your character legs go up, maybe you didn't setup your raycast length properly, so there is bad collision? You should check ik_raycastheight parameter, it must be lower than your raycast length. As for the parameters tweaking. "minmax_interpolation" - I am using it for clamping. Minimum interpolation should be left around 0.03 because there is bug? in Godot. Not sure why but if you set it 0 your animation will stop instead being used 100%. As for maximum value you could use anything you want between min value and 1, I prefer to set it a little bit lower than 1, but you can limit also in your animation graphs (by setting value other than 1). I do not recommend setting it as 1.0 actually because it's looks "sticky", especially for running animations. "foot offset" gives you ability to manipulate raycast calculated height, sometimes it's a little bit off, so your foot is always in ground or in the air after IK. "ik raycastheight" moves a raycast up above the foot by this value it's useful when you want to detect not only lower terrain by also anything higher than your foot. As for sensitivity of IK depending on target position, I saw that too in this basic script, I set my targets a little bit back to my character. In my "production" script I am actually using another bone attachments for knees to setup as magnets, and I am using a basis of foot attachment for proper front foot orientation right now. Not sure what fixes this problem, but I cannot reproduce it right now.

  • @SYBIOTE
    @SYBIOTE 3 роки тому

    ok ,but will this work if I want to implement dynamic crouching?
    I want the legs to bend while walking , but I want the feet to be properly planted

  • @bitmammothOG
    @bitmammothOG 3 роки тому +2

    When we enable the magnet I get a very weak effect when I move the target container node. What do we set the magnet "Z" based on and is that what is causing this issue?

    • @wojtek_pe
      @wojtek_pe  3 роки тому +2

      Hi, the magnet value basically describes how your joint is rotating. In my case, it just sets the direction the knee should be bent to. So it acts as a "magnet" for a knee. Without it the joint will act weird. Proper value really depends on your model. If you have it rotated other way than mine or your scale is way bigger than value "10" at "Z" will be bad. Just place your target container node in some place where your leg should be able to be positioned. Than experiment with different magnet values. At some point it should looks natural in every position of target container. You should also check if you selected proper bones for SkeletonIK. I am using mixamo rig with Godot Game Tools addod for Blender.

    • @bitmammothOG
      @bitmammothOG 3 роки тому

      @@wojtek_pe I have just seen this reply and appreciate the information, it is extremely helpful to me! It was on a custom rig and model with its own ik so it makes sense the scaling could be very different. I will look into what mixamo outputs closely and see if I can get a nice result. Cheers! :)

  • @manusiatidakbiasa
    @manusiatidakbiasa 3 роки тому +1

    Thank you

  • @ginoleeswan1454
    @ginoleeswan1454 3 роки тому +1

    THANK YOU

  • @Crossbow123
    @Crossbow123 2 роки тому

    Thank you for the tutorial. I was wondering what license governs the code for the foot IK in your video? Can I freely use the code?

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

      Since when is coding copyrighted lol😂 ?

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

      @@Velsia ​ Well, code IS copyrighted. Even that on stackoverflow. You are not allowed to use it however you like. See ToS. But most people don't care about these rules and chances you get sued are negligible. Its more of an ehtical / moral issue when you don't abide by the rules.

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

      Use it however you like. All code in my videos can be treated as MIT licensed

  • @anindyaroythetechmaster
    @anindyaroythetechmaster 3 роки тому +1

    Hey, how do you edit gd script in visual studio instead of the default editor? Also, is there any benefit in doing so?

    • @wojtek_pe
      @wojtek_pe  3 роки тому

      Hi, to be honest I don't remember how bad was default editor, I use vs code in my daily work so I am used to it. Integration is pretty easy, there is a tutorial on youtube by Gamefromscratch. As for benefits, I think it's easier to manage multiple files in a tree comparing to a list in built in editor (if it didn't change). There is also pretty nice autocomplete, and auto formatter. Also there is a lot of plugins for vs code not directly related to gdscript.

    • @5minutemovies977
      @5minutemovies977 3 роки тому

      ua-cam.com/video/Do0YZocTu80/v-deo.html

    • @anindyaroythetechmaster
      @anindyaroythetechmaster 3 роки тому

      @@wojtek_pe Well I think uaing visual studio code is advantageous only if you jave dual monitors or a very large monitor as you don't have to constantly switch between the script editor and the scene editor. But if you work with only a single monitor then it is of no advantage or may even be disadvantageous since visual studio will use additional resources.

    • @ChrisD__
      @ChrisD__ 3 роки тому

      @@anindyaroythetechmaster You also don't get autocomplete for node's in your scene.

    • @anindyaroythetechmaster
      @anindyaroythetechmaster 3 роки тому

      @@ChrisD__ You actually get autocomplete for nodes if you type variable types for every node. Ever since I came to know about it, I began to static type GDScript and now I always get autocomplete for every node.

  • @MssJustyna
    @MssJustyna 3 роки тому +2

    👌

  • @th3lazyguy
    @th3lazyguy 3 роки тому

    THANKS!!!!!!!!!!!

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

    What about stairs?! 😅

  • @lovehartLH
    @lovehartLH 3 роки тому

    Could you share a download for your Player.tscn scene/script?

  • @myprivatechannel1695
    @myprivatechannel1695 2 роки тому

    COOL

  • @chaqsilent
    @chaqsilent 3 роки тому

    Can an addon/plugin be made from this? If so, does anybody know how?

  • @riandhrasetiawan8226
    @riandhrasetiawan8226 3 роки тому

    How do you make the Character?

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

    This method doesn't seem to work anymore in Godot 4.3🤥

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

      its work dude, i tested it right now.

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

      @@badstorygames5391 Glad to hear it, but it doesn't work for me with version 4.3

  • @geekosnow6944
    @geekosnow6944 3 роки тому

    Where did you learn gdscript

    • @wojtek_pe
      @wojtek_pe  3 роки тому

      Hi, you should check docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html If you are a software developer it's similar to python so it's really easy to learn. Just start doing some games with godot and you will find it natural to use.

  • @pawelwrzesien5232
    @pawelwrzesien5232 3 роки тому

    Polak :) ?

  • @Arthur-dp7ys
    @Arthur-dp7ys 3 роки тому

    Dislike. Is it so hard to post a code somewhere? I can read it properly from video